Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue showing White space in recyclerview android. #240

Open
umerharris opened this issue Dec 10, 2021 · 1 comment
Open

Performance issue showing White space in recyclerview android. #240

umerharris opened this issue Dec 10, 2021 · 1 comment

Comments

@umerharris
Copy link

I'm using range chart in recyclerView, But some time it is showing white space and some time it is working fine. Can you guide me how can properly load the chart in recyclerview every time?
Screenshot_20211210_155505

//initialize this one time in view holder
anyChartView = root.findViewById(R.id.any_chart_view);
linearGauge = AnyChart.linear();

//assign values in onBindViewHolder function

holder.linearGauge.data(new SingleValueDataSet(new Double[]{data}));
holder.linearGauge.layout(Layout.HORIZONTAL);

            holder.linearGauge.credits().enabled(false);
            holder.linearGauge.tooltip(false);
            holder.linearGauge.interactivity().selectionMode(SelectionMode.NONE);

            holder.linearGauge.scaleBar(0)
                    .width("10%")
                    .from(min)
                    .to(minNorm)
                    .fill("#2a91f1");

            holder.linearGauge.scaleBar(1)
                    .width("10%")
                    .from(minNorm)
                    .to(maxNorm)
                    .fill("#4fe61e");

            holder.linearGauge.scaleBar(2)
                    .width("10%")
                    .from(maxNorm)
                    .to(max)
                    .fill("#2a91f1");

            holder.linearGauge.marker(0)
                    .type(MarkerType.TRIANGLE_DOWN)
                    .hatchFill(false)
                    .color(markerColor)
                    .width("15%")
                    .offset("-17.0%")
                    .zIndex(10);

            holder.linearGauge.marker(0).labels()
                    .enabled(true)
                    .fontColor(markerColor)
                    .width("20%")
                    .offsetX(24)
                    .offsetY(-30);

            holder.linearGauge.scale()
                    .minimum(min)
                    .maximum(max);

            holder.linearGauge.axis(0)
                    .width("1%")
                    .offset("10%")
                    .scale(holder.linearGauge.scale())
                    .orientation(Orientation.BOTTOM)
                    .labels("bottom");

            holder.linearGauge.padding(0, 20, 0, 20);
            if(holder.anyChartView.getTag().equals("false")){
                holder.anyChartView.setChart(holder.linearGauge);
            }
            holder.anyChartView.setOnRenderedListener(new AnyChartView.OnRenderedListener() {
                @Override
                public void onRendered() {
                    holder.anyChartView.setTag("true");
                    holder.linearGauge.autoRedraw();
                }
            }); 
@Shestac92
Copy link

@umerharris
At the moment we can guarantee expected behavior and normal performance in the single view just like it is described in the wiki guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants