Creating Charts

edited 9:04PM in FastReport .NET
Hi guys,

Hope someone can help me. I have a table that looks as follow(Refer to attachment)


I need to display the Columns (00:00 - 18:00) on the x-axis and the values of these columns in the y-axis per Name. Each name will have its own chart and a chart will be only for a singe date that the uses selected.

Can someone help or give advice?

Thanks

Comments

  • edited 9:04PM
    Hello,

    You need to fill the chart in code. To do this, put a new chart object on the page,create MSChart1.BeforePrint event handler and write the following code in it:
        private void MSChart1_BeforePrint(object sender, EventArgs e)
        {
          MSChart1.Series.ResetData();
          MSChart1.Series[0].AddValue("00:00", Report.GetColumnValue("your_table.00:00"));
          MSChart1.Series[0].AddValue("01:00", Report.GetColumnValue("your_table.01:00"));
          ...
        }
    
  • edited 9:04PM
    AlexTZ wrote: »
    Hello,

    You need to fill the chart in code. To do this, put a new chart object on the page,create MSChart1.BeforePrint event handler and write the following code in it:
        private void MSChart1_BeforePrint(object sender, EventArgs e)
        {
          MSChart1.Series.ResetData();
          MSChart1.Series[0].AddValue("00:00", Report.GetColumnValue("your_table.00:00"));
          MSChart1.Series[0].AddValue("01:00", Report.GetColumnValue("your_table.01:00"));
          ...
        }
    


    Thanks for the help. Works 100%

Leave a Comment