Hi,
I've been able to create a chart that fits my need except for one requirement which is to show all the series value in a single tooltip (CategoryAxis CrossHairToolTip).
I have 4 series (Weight1, Time1, Weight2, Time2) and 1 category (Period). By default i can easily show the CategoryAxis value in the CategoryAxis CrossHair Tooltip, but what i want to do is show the value of Weight1, Time1, Weight2 and Time2 in that tooltip.
Here is the code that show the Category value. and in comment what i would like to show instead.
Thanks in advance for your help.
I've been able to create a chart that fits my need except for one requirement which is to show all the series value in a single tooltip (CategoryAxis CrossHairToolTip).
I have 4 series (Weight1, Time1, Weight2, Time2) and 1 category (Period). By default i can easily show the CategoryAxis value in the CategoryAxis CrossHair Tooltip, but what i want to do is show the value of Weight1, Time1, Weight2 and Time2 in that tooltip.
Here is the code that show the Category value. and in comment what i would like to show instead.
Thanks in advance for your help.
<%: Html.Kendo().Chart<Data.DonneeChart>()
.Name(
"chart"
)
.Title(
"Multiple Series Chart"
)
.DataSource(dataSource => dataSource
.Read(read => read.Action(
"Charts_Data"
,
"Home"
)).ServerOperation(
false
)
)
.Series(series => {
series.Line(model => model.Weight1)
.Color(
"#ff1a1c"
)
.Name(
"Weight1"
)
.Axis(
"weight"
);
series.Line(model => model.Time1)
.Color(
"#ff0e00"
)
.Name(
"Time1"
)
.Axis(
"time"
);
series.Line(model => model.Weight2)
.Color(
"#73e100"
)
.Name(
"Weight2"
)
.Axis(
"weight"
);
series.Bar(model => model.Time2)
.Color(
"#007aff"
)
.Name(
"Time2"
)
.Axis(
"time"
);
})
.CategoryAxis(axis => axis
.Categories(model => model.Period)
.AxisCrossingValue(0,9999,9999)
.Justify(
true
)
.Crosshair(crosshair => crosshair
.Visible(
true
)
.Tooltip(tooltip => tooltip
.Visible(
true
)
.Template(
"Category : #= value #"
)
// Here i would like to show the value of Weight1,Time1,Weight2,Time2 instead of Period value !!!
.Format(
"{0:n1}"
)
))
)
.ValueAxis(axis => axis
.Numeric(
"weight"
)
.Min(0)
.Title(
"(Kg)"
)
.Max(8000)
)
.ValueAxis(axis => axis
.Numeric(
"weight"
)
.Color(
"#ffae00"
)
.Min(0)
.Max(35)
)
.ValueAxis(axis => axis
.Numeric(
"weight"
)
.Color(
"#007eff"
)
.Min(0)
.Max(1.1)
)
.Tooltip(tooltip => tooltip
.Visible(
false
)
)
%>