SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components

0
0

Hello there. At the beginning of the program, I define the workspace as w=10 and h=10 units. I set the new workspace to 5×5 in a button event. The new workspace is created but the old 10×10 volume remains on the screen. When I create the new workspace I want the old one to disappear. Thank you in advance for your help. Good work.

My button event.

btnSetNewWH.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
w = 5;
h = 5;
ds3d = new UniformGridDataSeries3D<>(Double.class, Double.class, Double.class, w, h);      

rs1 = sciChart3DBuilder.newSurfaceMeshSeries3D()
        .withDataSeries(ds3d)               
        .withDrawMeshAs(DrawMeshAs.SolidWireframe)
        .withStroke(0xFFE0E0E0)
        .withStrokeThicknes(1f)
        .withMaximum(5000)
        .withDrawSkirt(false)
        .withMeshColorPalette(new GradientColorPalette(colors, stops))
        .withOpacity(1.0f)
        .build();

surface3d.setTheme(R.style.SciChart_ElectricStyle);
surface3d.setCamera(camera);
surface3d.setXAxis(xAxis);
surface3d.setYAxis(yAxis);
surface3d.setIsFpsCounterVisible(false);
surface3d.setZAxis(zAxis);
surface3d.getRenderableSeries().add(rs1);
surface3d.getChartModifiers().add(sciChart3DBuilder.newModifierGroupWithDefaultModifiers().build());
    }
});
Version
4.1.0
Images
  • You must to post comments
0
0

Hello Yura. My problem was due to another error in my program. My problem was solved with the piece of code you provided. Thank you so much.

Best regards…

  • You must to post comments
0
0

Hi Yura. Thank you for your answer. I have tried this method before. Unfortunately the problem persists.

        surface3d.getRenderableSeries().remove(rs1);

    surface3d.setTheme(R.style.SciChart_ElectricStyle);
    surface3d.setCamera(camera);
    surface3d.setXAxis(xAxis);
    surface3d.setYAxis(yAxis);
    surface3d.setIsFpsCounterVisible(false);
    surface3d.setZAxis(zAxis);
    surface3d.getRenderableSeries().add(rs1);
    surface3d.getChartModifiers().add(sciChart3DBuilder.newModifierGroupWithDefaultModifiers().build());
Images
  • Yura Khariton
    I don’t understand the code that you posted – you removed series, but then you add it one more time. Or you remove rs1 series before adding new series in button event listener? It’s unclear from your response. Can you provide a full project which reproduces this issue so I can debug it?
  • You must to post comments
0
0

Hi Mustafa,

Can you try to remove existing RenderableSeries from RenderableSeries collection of chart? This should remove it from screen:

surface3d.getRenderableSeries().remove(rs1);

Is this suitable for your needs?

Best regards,
Yura

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.