Welcome Guest Search | Active Topics |

SteplLine nullhandling
mattti
#1 Posted : Thursday, March 6, 2014 4:56:25 AM(UTC)
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]
Ivan
#2 Posted : Friday, March 7, 2014 4:33:10 AM(UTC)
Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 11/5/2012(UTC)
Posts: 131

Thanks: 0 times
Was thanked: 15 time(s) in 15 post(s)
I've sent you an answer via email.
Best,
Ivan Petrov
jqChart Inc.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.070 seconds.