Getting StartedPerformance !!!Chart DataBar and Column ChartsLine and Area ChartsPie and Funnel ChartsScatter and Bubble ChartsRadar and Polar ChartsFinancial ChartsGantt ChartsCombinational ChartsDynamic ChartsWorking with Chart AxesChart FeaturesCustomizing ChartClient-Side Events |
This sample demonstrates how a chart palette can be specified.
For detailed implementation, please take a look at the HTML code tab. <!DOCTYPE html> <html> <head> <title> Chart Palettes Example - JavaScript Chart by DataViz Charts </title> <link rel="stylesheet" type="text/css" href="../../css/dataviz.chart.css" /> <link rel="stylesheet" type="text/css" href="../../themes/le-frog/styles.css" /> <script src="../../js/dataviz.chart.min.js" type="text/javascript"></script> <script lang="javascript" type="text/javascript"> var chart = new DataViz.Chart({ title: { text: 'Custom Colors' }, legend: { location: 'bottom' }, paletteColors: { type: 'customColors', customColors: ['#A0522D', '#D2691E', '#8B0000', '#CD853F'] }, animation: { duration: 1 }, axes: [ { type: 'category', location: 'bottom', categories: ['A', 'B', 'C', 'D'] } ], series: [ { type: 'column', title: 'Series 1', data: [62, 70, 68, 58] }, { type: 'column', title: 'Series 2', data: [56, 50, 62, 65] }, { type: 'column', title: 'Series 3', data: [60, 55, 42, 68] }, { type: 'column', title: 'Series 4', data: [68, 30, 56, 40] } ] }); chart.write('container'); </script> </head> <body> <div> <div id="container" style="width: 500px; height: 300px;"> </div> </div> </body> </html> |