This is a migrated thread and some comments may be shown as answers.

Specify Series name in Data

1 Answer 48 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
robert hutchison
Top achievements
Rank 1
robert hutchison asked on 30 Nov 2015, 01:40 PM

Hi,

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.

Thanks,
Rob

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 30 Nov 2015, 02:46 PM

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.

Regards,

Marin Bratanov
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
Tags
Chart (HTML5)
Asked by
robert hutchison
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or