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) => {
makeRadarRange(radarCategoryAxis, "septiembre", "diciembre", radarRangeColors[3], 3);
makeRadarRange(radarCategoryAxis, "diciembre", "diciembre", radarRangeColors[0], 1);
radarChart.cursor = new am4charts.RadarCursor(); //FIXME: cursors are offset
radarChart.cursor = new am4charts.RadarCursor();
// add line legend
radarChart.legend = new am4charts.Legend();
......@@ -263,7 +263,6 @@ const makeLineChart = (data) => {
const makeAreaChart = (data) => {
let areaChart = am4core.create("areaChart", am4charts.XYChart);
let areaTitle = areaChart.titles.create();
areaTitle.text = "Superficie acumulada";
areaTitle.fontSize = 10;
......@@ -272,13 +271,12 @@ const makeAreaChart = (data) => {
areaChart.data = data;
// chart.dateFormatter.inputDateFormat = "dd-mm-yyyy";
let areaDateAxis = areaChart.xAxes.push(new am4charts.DateAxis());
areaDateAxis.renderer.minGridDistance = 60;
areaDateAxis.renderer.minGridDistance = 50;
areaDateAxis.fontSize = 10;
areaDateAxis.renderer.labels.template.fill = am4core.color(mainTextColor);
areaDateAxis.startLocation = 0.5;
areaDateAxis.endLocation = 0.5;
areaDateAxis.startLocation = 0.45;
areaDateAxis.endLocation = 0.55;
areaDateAxis.baseInterval = {
timeUnit: "month",
count: 1
......@@ -302,8 +300,7 @@ const makeAreaChart = (data) => {
makeDateRange(areaDateAxis, 11, 1, "#E1DBC8");
areaChart.cursor = new am4charts.XYCursor();
areaChart.snapToSeries = areaSeries2;
areaChart.cursor.xAxis = areaDateAxis;
//areaChart.cursor.xAxis = areaDateAxis;
areaChart.scrollbarX = new am4core.Scrollbar();
areaChart.scrollbarX.minHeight = 1;
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