tdgchart

Getting Started

These steps define the information you need to include in your HTML file to draw a chart using tdgchart.

  1. Define the tdgchart.js file in the script tag.
    <script type="text/javascript" src="tdgchart.js"></script>;
    
  2. Define the target location in your web page to draw the chart. Example:
    <div class='chart' id='chart1'></div>;
    
  3. Create the chart in a script type tag.
    <script type="text/javascript">
    var chart = new tdgchart();
    
  4. Draw the chart.
    chart.draw('chart1');
    </script>
    

A single parameter may be supplied with the tdgchart() function to specify properties that define the appearance of a chart. Example:

var props = {
	data: [[1,3,5,3,1],[2,4,6,4,2],[5,3,1,3,5],[6,4,2,4,6]],
	chartType: 'line',
	border: {width: 2, color: 'grey'},
	title: {text: 'tdgchart', font: 'bold 12pt Sans-Serif', color:'rgb(0,101,163)'},
	chartFrame: {border: {width: 1, color: 'cyan'}, fill: {color: 'hsla(140, 100%, 50%, 0.1)'}},
	blaProperties: {orientation: 'vertical',lineConnection: 'curved'},
	dataLabels: {visible: false},
	series: [
		{series: 0, color:'rgb(0,142,126)', marker: {visible: true}},
		{series: 1, color:'rgb(152,181,211)', marker: {visible: true}},
		{series: 2, color:'rgb(0,101,163)', marker: {visible: true}},
		{series: 3, color:'rgb(173,204,189)', marker: {visible: true}}
	]
};
var chart = new tdgchart(props);
chart.draw('chart2');

Notes