Line chart issue

2 posts, 0 answers
  1. Grtjn
    Grtjn avatar
    129 posts
    Member since:
    Feb 2010

    Posted 15 Mar 2010 Link to this post

    Hi,

    I want to draw a line chart with data from my database.
    I already did make a barchart this way, so I just used that code to create the linechart.

    Now my problem is showing datetime on the x-axis.
    This worked just fine with the barchart, but with the linechart the dates aren't shown!

     

    SeriesMapping

     

    smLine = new SeriesMapping();

     

    smLine.ItemMappings.Add(

    new ItemMapping("Percentage", DataPointMember.YValue));

     

    smLine.ItemMappings.Add(

    new ItemMapping("Time", DataPointMember.XValue));

     

    LineChart.SeriesMappings.Add(smLine);

    LineChart.DefaultSeriesDefinition =

    new LineSeriesDefinition()

     

    {

    ShowItemLabels =

    true,

     

    ShowItemToolTips =

    true,

     

    };

    LineChart.ItemsSource = e.Result;

    XAxis:

     

    LineChart.DefaultView.ChartArea.AxisX.Title =

    "OEE & Losses";

     

    LineChart.DefaultView.ChartArea.AxisX.LabelRotationAngle = 45;

    LineChart.DefaultView.ChartArea.AxisX.DefaultLabelFormat =

    "HH:mm";

     

    LineChart.DefaultView.ChartArea.AxisX.LayoutMode =

    AxisLayoutMode.Inside;

     

  2. Grtjn
    Grtjn avatar
    129 posts
    Member since:
    Feb 2010

    Posted 16 Mar 2010 Link to this post

    This problem has been solved.
    Found some incorrect code and now everything goes just fine!

    Kind regards,

    Gertjan
Back to Top