var chart = new Cosfire.Chart("chart-div",{width:700,
height:250});
/* Create instance of Font */
titles :[{text: 'Chart Title1',
fontWeight: 'bolder'},
{text: 'Chart Title2',
fontSize:18,
fontColor: '#d10a14'}];
data: [{
plotAs: 'stackedColumn',
points: [
{xLabel: "January", y: 50},
{xLabel: "February", y: 60},
{xLabel: "March", y: 75},
{xLabel: "April", y: 40},
{xLabel: "May", y: 70},
{xLabel: "June", y: 45},
{xLabel: "July", y: 30},
{xLabel: "August", y: 80}
]
},
{plotAs: 'stackedColumn',
points: [
{xLabel: "January", y: 120},
{xLabel: "February", y: 100},
{xLabel: "March", y: 150},
{xLabel: "April", y: 170},
{xLabel: "May", y: 90},
{xLabel: "June", y: 70},
{xLabel: "July", y: 140},
{xLabel: "August", y: 110}
]
}
];
/* Add the font to chart */
chart.setData(data);
chart.render();
var chartJSON = {
width: 700,
height: 250,
titles: [{ text: 'Chart Title1',
fontWeight: 'bolder' },
{ text: 'Chart Title2',
fontSize: 18,
fontColor: '#d10a14'
}],
data: [{ plotAs: 'stackedColumn',
points: [{ xLabel: "January", y: 50 },
{ xLabel: "February", y: 60 },
{ xLabel: "March", y: 75 },
{ xLabel: "April", y: 40 },
{ xLabel: "May", y: 70 },
{ xLabel: "June", y: 45 },
{ xLabel: "July", y: 30 },
{ xLabel: "August", y: 80 }]
},
{ plotAs: 'stackedColumn',
points: [{ xLabel: "January", y: 120 },
{ xLabel: "February", y: 100 },
{ xLabel: "March", y: 150 },
{ xLabel: "April", y: 170 },
{ xLabel: "May", y: 90 },
{ xLabel: "June", y: 70 },
{ xLabel: "July", y: 140 },
{ xLabel: "August", y: 110 }]
}]
};
chart = new Cosfire.Chart("chart-div", chartJSON);
chart.render();
| Size Of The Font In Pixel | ||||
| Property | Type | Default | Possible Values | Description |
|---|---|---|---|---|
| fontSize | Number |
Not set | Number > 0 | Size of the font in pixel. |
| fontcolor | String |
Not set | The fontcolor property is used to set the color
of the text. The color is specified by:
|
--- |
| fontFamily | String |
Arial | --- | Any browser supported font family or installed google font. |
| fontStyle | String |
normal |
|
--- |
| fontWeight | String |
normal |
|
--- |