Use of null values in data

May 17, 2012 at 9:44 PM

I am trying to create a bar graph using the scatter type. Essentially I am creating a start point and an end point, then terminating the line by inserting a null value. I have the code working using the traditional javascript implementation for highcharts and I am trying to port it over to this highchart.Net module. The graph represents machine usage in various departments. Conceptually it should look like this

dept 1    -----       --------------  --- 
dept 2             ------         -----      --------------------
dept 3  -------------------------------------     ------------

The format of a single javascript series is shown below. In the traditional implementation, this sets a line between the first 2 points, then the third point terminates the line. Then another series of 3 creates another bar elsewhere on the chart. I am using this to depict time slots on a graph; horizontal x axis is time, y axis are different departments.

    series:[{"name":"Usage","color":"#E4E7F2",
    "data":[
    {"x":new Date(2012,4,15,9,31),"y":0.5},
    {"x":new Date(2012,4,15,12,53),"y":0.5},
    {"x":new Date(2012,4,15,12,53),"y":null},
        ]}]

 

My current code for a single point in highcharts.net is

            _pointCollection.Add(new Point(Convert.ToInt64((DateTime.Parse(new DateTime(2012, 4, 15, 9, 31, 0).ToString()).Subtract(new DateTime(1970, 1, 1))).TotalMilliseconds),  1 ));
            _pointCollection.Add(new Point(Convert.ToInt64((DateTime.Parse(new DateTime(2012, 4, 15, 12, 53, 0).ToString()).Subtract(new DateTime(1970, 1, 1))).TotalMilliseconds), 1 ));
            _pointCollection.Add(new Point(Convert.ToInt64((DateTime.Parse(new DateTime(2012, 4, 15, 12, 53, 0).ToString()).Subtract(new DateTime(1970, 1, 1))).TotalMilliseconds), null));

The bolded y-values are my issue. When I exclude the third line, I get data. Only problem with this is the usage lines between the different departments are connected which makes no logical sense. If I include the 3rd line, the script never finishes - I get timeout errors.

Any ideas? This has stumped me for a few days now. Thanks in advance,

Brian