Rank: Newbie
Groups: Registered
Joined: 3/6/2014(UTC) Posts: 4
Thanks: 0 times Was thanked: 0 time(s) in 0 post(s)
|
Hi, is it possible to use StepLine chart and make it connect null values(NullHandling)? NullHandling is working perfectly in other chart types but it is not even option in StepLine chart type. Is it by design or just forgotten method? Thanks This is my code, second series(orange, right y axis) is StepLine: Code:var data = new List<ChartModel>();
data.Add(new ChartModel(new DateTime(2014, 2, 1), 1, null)); data.Add(new ChartModel(new DateTime(2014, 2, 2), 2, 60)); data.Add(new ChartModel(new DateTime(2014, 2, 3), 1, null)); data.Add(new ChartModel(new DateTime(2014, 2, 3), null, 52)); data.Add(new ChartModel(new DateTime(2014, 2, 3), 3, null)); data.Add(new ChartModel(new DateTime(2014, 2, 4), null, 75)); data.Add(new ChartModel(new DateTime(2014, 2, 5), null, 10)); data.Add(new ChartModel(new DateTime(2014, 2, 6), 2, 50)); data.Add(new ChartModel(new DateTime(2014, 2, 7), null, 80)); data.Add(new ChartModel(new DateTime(2014, 2, 7), 1, 90)); data.Add(new ChartModel(new DateTime(2014, 2, 8), null, 100)); data.Add(new ChartModel(new DateTime(2014, 2, 9), 3, null));
return data; Code:@(Html.JQChart() .Chart(Model) .ID("jqChart") .Width(1000) .Height(400) .Title("Assigning Axis") .Shadows(true) .Tooltips(tooltips => tooltips.TooltipsType(TooltipsType.Shared)) .Animation(TimeSpan.FromSeconds(1)) .Crosshairs(el => el.Enabled(true).VerticalLine(line => line.StrokeStyle("red")).HorizontalLine(false)) .Border(border => { border.LineWidth(1); border.CornerRadius(0); border.StrokeStyle("#EEE"); }) .Animation(TimeSpan.FromSeconds(1)) .Axes(axis => { axis.DateTimeAxis(Location.Bottom) .ZoomEnabled(true);
axis.LinearAxis(Location.Left) .Name("Y1") .CustomTickMarks(new int[] { 1, 2, 3 }) .ZoomEnabled(false) .VisibleMinimum(0.0) .VisibleMaximum(3.0);
axis.LinearAxis(Location.Right) .Name("Y2") .CustomTickMarks(new[] { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }) .ZoomEnabled(false) .VisibleMinimum(0.0) .VisibleMaximum(100.0) .StrokeStyle("#FCB441") .MajorGridLines(el => el.LineWidth(0)); } ) .Series(series => { series.Line().AxisY("Y1") .XValues(el => el.Label) .YValues(el => el.Value1) .NullHandling(NullHandling.Connect);
series.StepLine().AxisY("Y2") .XValues(el => el.Label) .YValues(el => el.Value2); //.NullHandling(NullHandling.Connect); } ) .Render() ) This is the output: [img]http://tinypic.com/r/2pt819t/8[/img]
|