1

About Android's SDK

I use PaletteProviderBase to set ColumnChart's color. but I found a bug about strokeColor is wrong.

1,some column bars can not draw stroke.

2,some column bars draw wrong stroke color.

My Codes:

private class ColumnsPaletteProvider extends PaletteProviderBase<FastColumnRenderableSeries> implements IFillPaletteProvider , IStrokePaletteProvider {
    private final IntegerValues colors = new IntegerValues();
    private final int[] desiredColors;

    protected ColumnsPaletteProvider() {
        super(FastColumnRenderableSeries.class);

        desiredColors = new int[]{Color.RED, Color.GREEN, Color.TRANSPARENT};

    }

    @Override
    public void update() {
        ColumnRenderPassData passData = (ColumnRenderPassData) this.renderableSeries.getCurrentRenderPassData();

        final int size = passData.pointsCount();
        colors.setSize(size);


        XyzDataSeries<Date, Double, Double> series = (XyzDataSeries<Date, Double, Double>) renderableSeries.getDataSeries();


        int startIndex = passData.xPointRange.getMin();
        int dataCount = series.getCount();

        final int[] colorsArray = colors.getItemsArray();
        for (int i = 0; i < size; i++) {
            int index = startIndex + i;
            if (index >= dataCount)
            {
                colorsArray[i] = desiredColors[2];
            }
            else
            {
                double direction = series.getZValues().get(index);
                if (direction == 1)
                {
                    colorsArray[i] = desiredColors[0];
                }
                else
                {
                    colorsArray[i] = desiredColors[1];
                }
            }
        }

    }

    @Override
    public IntegerValues getFillColors() {
        return colors;
    }

    @Override
    public IntegerValues getStrokeColors() {
        return colors;
    }
}

I found these errors will display, when I set Surface.setRenderSurface().

RenderSurface renderSurface = new RenderSurface(surface.getContext());
renderSurface.setBackgroundColor(Color.TRANSPARENT);
mSurface.setRenderSurface(renderSurface);

Because my app display will show black background.

error screenshot 1

error screenshot 2

Rey
  • 19
  • 2
  • Unfortunately I couldn't reproduce this problem. I've tried to use your code with 'Column Chart' example ( https://www.scichart.com/example/android-column-chart-example/ ) and I haven't seen the behavior from screenshot. Can you provide some additional information(e.g. data from data series, chart configuration etc) or entire project which allows to reproduce this issue? – Yura Khariton May 24 '18 at 07:06
  • thank you! I code with "CreateMultiPaneStockChartFragment" from demo. I try to delete all chart configuration, it also exist. how i send my codes to you? – Rey May 24 '18 at 08:14
  • You can edit this question and add modified code of example here. Or you can report it [here](http://support.scichart.com/index.php?/Tickets/Submit) and attach source code in ticket. – Yura Khariton May 24 '18 at 08:29
  • Hi @Rey. Stackoverflow is a public question and answer site. You should not be posting TeamViewer meeting ID's here. If you have a programming question, use stack overflow. If you want to report a bug in a software library, report the bug to the library owners. – Dr. Andrew Burnett-Thompson May 24 '18 at 09:15
  • I found reason.. – Rey May 25 '18 at 07:09
  • Thanks. I could reproduce this issue. I'm going to investigate why it occurs – Yura Khariton May 25 '18 at 09:05

1 Answers1

1

I investigated this issue and discovered that it was a bug in RenderSurface implementation. It should be fixed now (starting from v2.1.0.2275 and above).

You can get fix with latest nightly build from our Maven repository. You can find instructions how to reference SciChart Android libraries from Maven in documentation.

Hope this will help you!

Yura Khariton
  • 484
  • 2
  • 6