syampillai/SOCharts

Cannot add lines to a chart

MyHouseIsBig opened this issue · 3 comments

I've tried almost everything to solve it by myself but i cannot find a way to create a line with a start position and an end position and add it to a chart. From your documentation that I found on here I coded the following. The xValues and yValues are some random values that I generated for a LineChart but I also tried with some custom numeric values.

Any help would be really appreciated ❤️.

        // Add a custom line on the chart
        Line line = new Line(new Shape.Point(xValues.get(99900), yValues.get(99900)), new Shape.Point(xValues.get(99990), yValues.get(99990)));
        line.setName("Linea importantissima");
        line.getStyle(true).setFillColor(new Color("red"));
        line.getStyle(true).setLineWidth(10);

        soChart.add(... , line);

This code is perfectly fine. I think the line is lying outside the canvas. Please check the values of the coordinates.
To verify that it is working, you could try:
Line line = new Line(new Shape.Point(100, 100), new Shape.Point(600, 600));

I'm closing this as this is not an issue.

Closed