var chart;
var chartData = [];
var chartCursor;
AmCharts.ready(function () {
// generate some data first
generateChartData();
// SERIAL CHART
chart = new AmCharts.AmSerialChart();
chart.pathToImages = "http://gadunews.pl/apps/googlePlay/amcharts/images/";
chart.zoomOutButton = {
backgroundColor: '#000000',
backgroundAlpha: 0.15
};
chart.dataProvider = chartData;
chart.categoryField = "date";
chart.balloon.bulletSize = 5;
// listen for "dataUpdated" event (fired when chart is rendered) and call zoomChart method when it happens
chart.addListener("dataUpdated", zoomChart);
// AXES
// category
var categoryAxis = chart.categoryAxis;
categoryAxis.parseDates = true; // as our data is date-based, we set parseDates to true
categoryAxis.minPeriod = "DD"; // our data is daily, so we set minPeriod to DD
categoryAxis.dashLength = 1;
categoryAxis.gridAlpha = 0.15;
categoryAxis.position = "top";
categoryAxis.axisColor = "#DADADA";
// value
var valueAxis = new AmCharts.ValueAxis();
valueAxis.axisAlpha = 0;
valueAxis.dashLength = 1;
chart.addValueAxis(valueAxis);
// GRAPH
for(var i=1;i<=5;i++)
{
var graph = new AmCharts.AmGraph();
switch(i)
{
case 1: graph.lineColor = "#000000"; break;
case 2: graph.lineColor = "#FF0000"; break;
case 3: graph.lineColor = "#FFFF00"; break;
case 4: graph.lineColor = "#00FF00"; break;
case 5: graph.lineColor = "#0000FF"; break;
}
graph.type = "line";
graph.title = "Ilość głosów "+i;
graph.valueField = "ocena"+i;
graph.bullet = "round";
graph.bulletBorderColor = "#FFFFFF";
graph.bulletBorderThickness = 2;
graph.lineThickness = 2;
graph.negativeLineColor = "#efcc26";
// graph.customBullet = "http://gadunews.pl/apps/googlePlay/amcharts/images/star.gif"; // bullet for all data points
graph.customBulletField = "customBullet";
graph.bulletSize = 14;
graph.hideBulletsCount = 50; // this makes the chart to hide bullets when there are more than 50 series in selection
chart.addGraph(graph);
}
var legend = new AmCharts.AmLegend();
legend.markerType = "circle";
chart.addLegend(legend);
// CURSOR
chartCursor = new AmCharts.ChartCursor();
chartCursor.cursorPosition = "mouse";
chartCursor.pan = true; // set it to fals if you want the cursor to work in "select" mode
chart.addChartCursor(chartCursor);
// SCROLLBAR
var chartScrollbar = new AmCharts.ChartScrollbar();
chart.addChartScrollbar(chartScrollbar);
// WRITE
chart.write("iloscOcen");
});
function generateChartData() {
Connect Error (1045) Access denied for user 'qrix_ggoceny'@'localhost' (using password: YES)