Specify Series name in Data

2 posts, 0 answers
  1. robert hutchison
    robert hutchison avatar
    17 posts
    Member since:
    Feb 2010

    Posted 30 Nov 2015 Link to this post


    What I see in the HTML chart control is almost what I need.  The closest that I can get to a "generic chart" (with everything specified in the data) is binding to the XMLDataSource, but even with that, it appears that the Series Name needs to be hard-coded (not included in the XML data) or we need to write code to replace a hard-coded value with an "out of band" supplied value for each of the series names.

    I've been looking through all of the demos and it appears that in every one of them, labels or titles that appear on the graph show up in the code somewhere.  Then when I look at the documentation, there is no place where those labels or titles can be extracted from the data source.  This would indicate to me that every graph needs to be hard-coded.

     Am I missing something?  I hope so.  We have potentially thousands of graphing possibilities that we need to implement and would like the user to be able to design their own and this control looks pretty good, except for the "hard-coding" thing.  If we could retrieve the series names from the XML input, the task would take days; if we need to individually code each chart, it will take months to staff-years.


  2. Marin Bratanov
    Marin Bratanov avatar
    3899 posts

    Posted 30 Nov 2015 Link to this post

    Hello Rob,

    You can create the series programatiacally by looping through the data. With this approach you can use a field in your data source for the series name, you would set it in exactly the same manner as the DataFieldY property.

    For a chart to work, it must have series defined, so it can set the desired properties (e.g., labels, templates, tooltips, colors, etc.). The control itself has no way of knowing the number of series and their settings (e.g., data fields) unless the developer supplies them.

    If you believe this can be achieved without the developer devising logic to generate series, I would advise that you post your idea in our feedback portal: http://feedback.telerik.com/project/108. This will let you explain exactly how you expect such a feature to work and how it should be exposed for configuration (you can even add pseudocode). In turn, this will let our clients evaluate, comment and vote on your idea and if it gains enough traction in the community, our management will consider its implementation.


    Marin Bratanov
    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