Commit 0d5fefe6 authored by Rodrigo Tapia-McClung's avatar Rodrigo Tapia-McClung

Fix cursor not showing for first month on area chart

parent 70d8e48c
...@@ -195,7 +195,7 @@ const makeRadarChart = (data, months, years) => { ...@@ -195,7 +195,7 @@ const makeRadarChart = (data, months, years) => {
makeRadarRange(radarCategoryAxis, "septiembre", "diciembre", radarRangeColors[3], 3); makeRadarRange(radarCategoryAxis, "septiembre", "diciembre", radarRangeColors[3], 3);
makeRadarRange(radarCategoryAxis, "diciembre", "diciembre", radarRangeColors[0], 1); makeRadarRange(radarCategoryAxis, "diciembre", "diciembre", radarRangeColors[0], 1);
radarChart.cursor = new am4charts.RadarCursor(); //FIXME: cursors are offset radarChart.cursor = new am4charts.RadarCursor();
// add line legend // add line legend
radarChart.legend = new am4charts.Legend(); radarChart.legend = new am4charts.Legend();
...@@ -263,7 +263,6 @@ const makeLineChart = (data) => { ...@@ -263,7 +263,6 @@ const makeLineChart = (data) => {
const makeAreaChart = (data) => { const makeAreaChart = (data) => {
let areaChart = am4core.create("areaChart", am4charts.XYChart); let areaChart = am4core.create("areaChart", am4charts.XYChart);
let areaTitle = areaChart.titles.create(); let areaTitle = areaChart.titles.create();
areaTitle.text = "Superficie acumulada"; areaTitle.text = "Superficie acumulada";
areaTitle.fontSize = 10; areaTitle.fontSize = 10;
...@@ -272,13 +271,12 @@ const makeAreaChart = (data) => { ...@@ -272,13 +271,12 @@ const makeAreaChart = (data) => {
areaChart.data = data; areaChart.data = data;
// chart.dateFormatter.inputDateFormat = "dd-mm-yyyy";
let areaDateAxis = areaChart.xAxes.push(new am4charts.DateAxis()); let areaDateAxis = areaChart.xAxes.push(new am4charts.DateAxis());
areaDateAxis.renderer.minGridDistance = 60; areaDateAxis.renderer.minGridDistance = 50;
areaDateAxis.fontSize = 10; areaDateAxis.fontSize = 10;
areaDateAxis.renderer.labels.template.fill = am4core.color(mainTextColor); areaDateAxis.renderer.labels.template.fill = am4core.color(mainTextColor);
areaDateAxis.startLocation = 0.5; areaDateAxis.startLocation = 0.45;
areaDateAxis.endLocation = 0.5; areaDateAxis.endLocation = 0.55;
areaDateAxis.baseInterval = { areaDateAxis.baseInterval = {
timeUnit: "month", timeUnit: "month",
count: 1 count: 1
...@@ -302,8 +300,7 @@ const makeAreaChart = (data) => { ...@@ -302,8 +300,7 @@ const makeAreaChart = (data) => {
makeDateRange(areaDateAxis, 11, 1, "#E1DBC8"); makeDateRange(areaDateAxis, 11, 1, "#E1DBC8");
areaChart.cursor = new am4charts.XYCursor(); areaChart.cursor = new am4charts.XYCursor();
areaChart.snapToSeries = areaSeries2; //areaChart.cursor.xAxis = areaDateAxis;
areaChart.cursor.xAxis = areaDateAxis;
areaChart.scrollbarX = new am4core.Scrollbar(); areaChart.scrollbarX = new am4core.Scrollbar();
areaChart.scrollbarX.minHeight = 1; areaChart.scrollbarX.minHeight = 1;
areaChart.scrollbarX.parent = areaChart.bottomAxesContainer; areaChart.scrollbarX.parent = areaChart.bottomAxesContainer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment