/**
* --------------------------------------------------------
* This demo was created using amCharts V4 preview release.
*
* V4 is the latest installement in amCharts data viz
* library family, to be released in the first half of
* 2018.
*
* For more information and documentation visit:
* https://www.amcharts.com/docs/v4/
* --------------------------------------------------------
*/
am4core.useTheme(am4themes_animated);
// Create chart instance
var chart = am4core.create("chartdiv", am4charts.XYChart);
chart.paddingTop = 40;
// Add data
chart.data = [{
"category": "SVM",
"value": 0.98
}, {
"category": "Neural Networks",
"value": 0.98
}];
// Create axes
var categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis());
categoryAxis.dataFields.category = "category";
categoryAxis.renderer.grid.template.location = 0;
function createValueAxis(title, showgrid) {
// Create axis
var axis = chart.yAxes.push(new am4charts.ValueAxis());
axis.renderer.grid.template.disabled = !showgrid;
// Set up axis title
axis.title.text = title;
axis.title.fontFamily='Arial';
axis.title.fontWeight='bold';
axis.title.fontSize = 14;
return axis;
}
function createSeries(key, title, axis) {
var series = chart.series.push(new am4charts.ColumnSeries());
series.dataFields.valueY = key;
series.dataFields.categoryX = "category";
series.yAxis = axis;
return series;
}
createSeries(
"value",
"Series #1",
createValueAxis("Accuracy", true)
);
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.