Graph with multiple line series - how to configure with data passed as DataContext at runtime

2 posts, 0 answers
  1. Bartosz
    Bartosz avatar
    3 posts
    Member since:
    Jul 2015

    Posted 28 May Link to this post

    Hi,


    I need a chart with one or more line series, configured in stand alone RD.
    The line series are Numerical on both axes (it's a temperature (X) vs value (Y) plot).

    The data for the Graph will be provided at runtime through object reference.

    My data source format is as follows:
    ```
    class Data
    {
       List<double> Temperature {g;s;}
       List<double> Value {g;s}
    }
    ```
    I was able to 'import' the dll to the designer and the data source was set up correctly (I know this because I'm able to use other data sources to successfully populate other elements of the report).

    ----------------------------------

    What I did so far?
    * I inserted a new line graph into the report
    * I tried setting the Category to Temperature and Value to Value in the Wizard
    * I named the graph to be able to find it at runtime and set it's DataSource
    * In various attempts to configure the graph I tried setting the X and Y axes of the Graph to Numerical type or X to Category and Y to Numerical (I get the legend and axes preview in the designer)
    * At runtime I set the DataSource of the Graph the same way as DataSource of a Table (which works ok for the table): `((Graph)(report.Items.Find("nameOfGraph", true)[0])).DataSource = dataSourceObject;`

    The problem I have is that there are no series in the generated report in the Graph while other parts of the report are populated correctly.

    Could you please provide me with a walktrough of how to configure a line Graph in Report Designer with the assumption that the data will be provided at runtime?

    Thanks!

  2. Todor
    Admin
    Todor avatar
    175 posts

    Posted 31 May Link to this post

    Hello Bartosz,

    We have already responded to your post with identical query (ticket #1169148). A sample solution demonstrating the proposed approach is also attached there - check A walktrough of how to configure a line Graph in report designer with data provided at runtime.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top