Search code examples
model-view-controllerhighchartsdotnethighcharts

Dotnethighcharts library


I've found a great libray at http://dotnethighcharts.codeplex.com/ It's a really great library, but i'm looking for someone who's willing to answer to the following question:

How do i setup a title in my MVC action for the chart? Setting the title itself it easy, but if i specify any single quotes in it, it will cause a syntax error.

I'd like to specify my chart title as f.e. "John's statistics". Making use of highcharts without dotnethighcharts is doable, but i'd rather use dotnethighcharts, since it allows me to specify the data in the backend and on pageload.

Could anyone tell me how to put comma's in a highchart title using this library?


Solution

  • In Highcharts (without dotnethighcharts module) there's a method called setTitle. As Mark wrote in the comment, this method accepts string and since it's passed to javascript, you should escape some characters (like " or ').

    Here you can learn how to do this in pure highcharts: http://jsbin.com/aqunun/1/