Hi Hristo,
Thanks for your reply.
The number format works fine. And I understand that I'll have to wait for sometime for the minor ticks.
Regarding the multiple series themselves, my actual design is a little more complicated than the sample I'd attached initially. I have a chart and a multiple-row selectable grid. Have a look at the attached screenshot.
In my MVC razor definition I have no series. When a row (in the grid) is (de)selected, I create the series-es by javascript. I do something like this :
chart.options.series = [];
if
(selectedInverters.length == 0)
return
;
$(selectedInverters.get().reverse()).each(
function
(i) {
var
index = selectedInverters.length - i - 1;
var
colourDefault = $(
this
).parent().parent().find(
'td.classColourTotal'
).html();
if
(
'@Model.Attributes.DataType'
==
"Power"
) {
var
colourPhase1 = $(
this
).parent().parent().find(
'td.classColourP1'
).html();
var
colourPhase2 = $(
this
).parent().parent().find(
'td.classColourP2'
).html();
var
colourPhase3 = $(
this
).parent().parent().find(
'td.classColourP3'
).html();
chart.options.series.push({
type:
"column"
,
name:
"["
.concat((index * 3),
"].Value"
),
color:
"#"
+ colourPhase1,
field:
"["
.concat((index * 3),
"].Value"
),
stack:
true
,
gap: 1
});
chart.options.series.push({
type:
"column"
,
name:
"Inverter "
.concat(index),
color:
"#"
+ colourPhase2,
field:
"["
.concat((index * 3) + 1,
"].Value"
),
stack:
true
,
gap: 1
});
chart.options.series.push({
type:
"column"
,
name:
"Inverter "
.concat(index),
color:
"#"
+ colourPhase3,
field:
"["
.concat((index * 3) + 2,
"].Value"
),
stack:
true
,
gap: 1
});
}
else
{
chart.options.series.push({
type:
"column"
,
name:
"Inverter "
.concat(index),
color:
"#"
+ colourDefault,
field:
"["
.concat(index,
"].Value"
),
stack:
true
,
gap: 1
});
}
});
chart.rebind({
duration: durationType,
datatype: dataType,
plantGuid:
'@Model.PowerPlantId'
});
In the ajax call I make sure the server logic return the correct array dimension and the order. The number of rows in the grid is also not known. It depends on the date widget on top.
I'd be grateful if you can suggest what are my best options in this case.
I prefer ajax binding and not sending a complex model like
@(Html.Kendo().Chart(Model)
...
...
@{
foreach(inveter in Model.Inverters)
{
.Series(series =>
{
series.Column(
model => model.Data[i],
model => model.Time
)
})
}
as this would involve posting the model each time some parameters changes, as there are some more widgets on my page and and everything needs to refresh if I post, each time
Thanks for your help
Regards
Achilles