Basic Column Chart - CanvasJS JavaScript Charts
Basic Column Chart - CanvasJS JavaScript Charts
HTML
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<br/><!-- Just so that JSFiddle's Result label doesn't overlap the Chart -->
<div id="chartContainer" style="height: 360px; width: 100%;"></div>
<div id="chartContainer2" style="height: 360px; width: 100%;"></div>
JavaScript
var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: true,
animationDuration: 600,
theme: "light1",
title: {
fontFamily: "verdana",
fontSize: 16,
text: "Трудозатраты"
},
subtitles: [{
fontFamily: "verdana",
fontSize: 12,
text: "администраторов за месяц (детально)"
}],
legend:
{
fontFamily: "verdana",
fontWeight:"normal",
fontSize: 12
},
axisY:{
titleFontFamily: "verdana",
titleFontSize:14,
interval: 10,
suffix: "%",
labelFontSize:10,
},
axisX:{
titleFontFamily: "verdana",
titleFontSize:14,
interval: 1,
labelFontSize:13,
},
toolTip:{
shared: true
},
data:[
{
type: "stackedBar100",
toolTipContent: "{name}: {y}ч. (#percent%)",
showInLegend: true,
name: "Доработки",
color: "green",
dataPoints: [
{ y: 0, label: "Иванов" },
{ y: 0, label: "Петров" },
{ y: 0, label: "Сидоров" },
]
},
{
type: "stackedBar100",
toolTipContent: "{name}: {y}ч. (#percent%)",
showInLegend: true,
name: "Восстановление...