How would you store Highcharts chart objects?
<p>I have started using Highcharts creating some very basic visualisations with some data. I used C#/MVC3 with a basic class called GraphOptions consisting of two properties, an array of string categories and an array of Graph Series (which has a name and data property). </p>

<p>I then stored a js graph configuration in a js file and populated its properties from the GraphOptions class returned as a JSON object. The configuration would look like this:</p>

<pre><code>var options = {
    chart: {
        renderTo: 'chartContainer',
        type: 'column'
    },
    title: {
        text: 'Strategic Cluster Average',
        x: -20 //center
    },
    subtitle: {
        text: '',
        x: -20
    },
    xAxis: {
        categories: []
    },
    yAxis: {
        title: {
            text: 'Score (%)'
        },
        min: 0
    },
    tooltip: {
        formatter: function () {
            return '&lt;b&gt;' + this.series.name + '&lt;/b&gt;&lt;br/&gt;' +
                    this.x + ': ' + this.y;
        }
    },
    plotOptions: {
        column: {
            pointPadding: 0.2,
            borderWidth: 0
        }
    },
    legend: {
        layout: 'vertical',
        backgroundColor: '#FFFFFF',
        align: 'left',
        verticalAlign: 'top',
        x: 100,
        y: 70,
        floating: true,
        shadow: true
    },
    series: []
}
</code></pre>

<p>The configuration above only renders a column chart at this stage. I was just wondering what the best way would be to accommodate all the chart types. Do I add a property to my Graph Options class called "GraphType" or do I rather store the whole chart configuration object and return it as part of a JSON object?</p>
