Spline; XAxis Datetime with one value per minute; individual PlotOptionsSeriesMarker

Aug 9, 2014 at 10:25 PM
Hello,
I am a beginner with Highcharts!

I'am trying to do a Spline-Chart for windspeed including direction (as Marker)
I have one value (speed and direction per minute) and would like to show the values of the past hour.

I am able to create the Series for WindSpeed, I used "new objects[,]".
But I do not know how do set individual PlotOptionsSeriesMarker to "objects". Is this only possible to set for Points?

So, should I use Points instead of objects [,] for my Data?
But how do I have to set the XAxis, so that I get a regular axis? (some points in the hour may be missing! And Categories are string [] and not of type = DateTime!!

Who can help me?

Here my code:
        WeatherDataProvider dap = new WeatherDataProvider();
        List<WeatherLoopData> datas = dap.GetWeatherLoopDatas("WHERE RecordTime > GetDate()- 0.05");
        int count = datas.Count;

        // not used: DotNet.Highcharts.Options.Point[] myPoints = new DotNet.Highcharts.Options.Point[count];

        Series seWindSpeed = new Series();
        Series seWindDir = new Series();
        object[,] objWindAvg1 = new object[count, 2];
        object[,] objWindDir = new object[count, 2];

        seWindSpeed.Name = "speed sur 1 min";
        seWindDir.Name = "direction";

        int dataPointNumber = 0;
        foreach (WeatherLoopData data in datas)
        {

            //object obj= new object ( dt); //, data.WindAvg1 };
            if (dataPointNumber < count)
            {
                //// load points: not used
                //DotNet.Highcharts.Options.Point myPoint = new DotNet.Highcharts.Options.Point();
                //myPoint.X = data.RecordTime.ToOADate();
                //myPoint.Y = Convert.ToDouble(data.WindAvg1);
                //myPoint.Marker = new PlotOptionsSeriesMarker { Symbol = "url(/Charts/content/images/sun.png)" };
                //myPoints[dataPointNumber] = myPoint;

                // objects
                objWindAvg1[dataPointNumber, 0] = data.RecordTime + (DateTime.Now - DateTime.UtcNow);
                objWindAvg1[dataPointNumber, 1] = Convert.ToDouble(data.WindAvg1);
                objWindDir[dataPointNumber, 0] = data.RecordTime + (DateTime.Now - DateTime.UtcNow);
                objWindDir[dataPointNumber, 1] = Convert.ToDouble(data.WindDir);

                dataPointNumber++;
            }

        }

        seWindSpeed.Data = new Data(objWindAvg1);
        seWindSpeed.Data = new Data(myPoints);
        seWindDir.Data = new Data(objWindDir);
        seWindDir.YAxis = "1";


        #region wind
        DotNet.Highcharts.Highcharts charts = new DotNet.Highcharts.Highcharts("chart")
            .InitChart(new Chart { DefaultSeriesType = ChartTypes.Spline })
            //.SetOptions(new GlobalOptions { Global = new Global { UseUTC = false } })  // throws an javascript exception
            .SetTitle(new Title { Text = "Monthly Average Temperature" })
            .SetSubtitle(new Subtitle { Text = "Source: WorldClimate.com" })
            .SetXAxis(new XAxis
            {
                Type = AxisTypes.Datetime,
                DateTimeLabelFormats = new DateTimeLabel { Minute = "%H:%M" },
                Reversed = true
            })
            .SetYAxis(new[]
            {
                new YAxis
                {
                    Title = new YAxisTitle { Text = "noeuds" },
                    Labels = new YAxisLabels { Formatter = "function() { return this.value }" },
                    Min = 0,
                    Max = 32,
                },
                new YAxis
                {
                    Title = new YAxisTitle { Text = "degree" },
                    Labels = new YAxisLabels { Formatter = "function() { return this.value }" },
                    Min = 0,
                    Max = 360,
                    Opposite = true
                }
            }
            )
            .SetTooltip(new Tooltip
            {
                Crosshairs = new Crosshairs(true),
                Shared = true
            })
            .SetSeries(new[] { seWindSpeed, seWindDir });

        //Series tokyo = ChartsData.TokyoSeries;
        ltrChart.Text = charts.ToHtmlString();

        #endregion wind