Pre loader

Tag: piechart

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0 votes
12k views

I am trying to disable segment selection of pie chart.
I didn’t found any property to do it and done following way:

  1. derived fron SciChartPieSurface
  2. overrides OnSegmentMouseDown with empty body

Is there better way to do this?

Thanks
Samvel

-1 votes
8k views

Hello Team,

In Pie Chart with DonutSeries, the segment spacing seems to have no effect on graph.

donutSeries.segmentSpacing = 10

Thanks

0 votes
7k views

Hello,

I get data from reading an URL so I save them (prepared) to a Arraylist (type PieSegment). How can I add the PieSegments from the Arraylist with (for example a loop) to my Piechart?

BR and thank you very much.
Marco

0 votes
10k views

I am extending a PieSegmentLabelFormatterBase to format the segment label of a piechart. however I cannot find any information regarding how I can change its size. So my question is How can I change the font size of piechart labels?

0 votes
11k views

Hi guys,

I have some troubles with piecharts in swift. I want to provide custom labels outside of the piecharts segments. I found a screenshot of a nested piechart attached to an issue in your issue tracker. Thats what I want to do in swift, but I couldn’t find out a way to do so. Could you please provide an example code?

Thanks a lot in advance!
Alex

0 votes
12k views

Hello, I hope you can help me! please
How could you reach this special design with androidchar.
it’s possible?
Please I need to know if it is feasible, with this I could start to carry out my project.
Thanks in advance.

0 votes
8k views

Hi, I would like to know if it is possible to do half-pie (as in the photo) with SciChartDonutSurface and if so how? Thanks!

  • mike laor asked 2 years ago
  • last active 2 years ago
0 votes
9k views

I tried to create a simple pie chart, but my app crashes with the following expection:

java.lang.NullPointerException: Attempt to invoke virtual method 'void com.scichart.drawing.common.FontStyle.initPaint(android.graphics.Paint)' on a null object reference
    at com.scichart.charting.visuals.renderableSeries.PieDonutDrawingManagerBase.a(SourceFile:118)
    at com.scichart.charting.visuals.renderableSeries.PieDonutDrawingManagerBase.drawLabels(SourceFile:110)
    at com.scichart.charting.visuals.renderableSeries.PieRenderableSeries.internalDraw(SourceFile:70)
    at com.scichart.charting.visuals.renderableSeries.PieDonutRenderableSeriesBase.onDraw(SourceFile:560)
    at com.scichart.charting.visuals.c.onDraw(SourceFile:62)
    at android.view.View.draw(View.java:16178)

Here is my initialization code (Kotlin):

override fun onViewCreated(view: View, savedInstanceState: Bundle?)
{
    super.onViewCreated(view, savedInstanceState)

    val chartSurface = view.findViewById(R.id.chart)
    val builder = SciChartBuilder.instance()

    val pieSeries = builder
        .newPieSeries()
        .withSegments(builder
                          .newPieSegment()
                          .withValue(40.0)
                          .build(),
                      builder
                          .newPieSegment()
                          .withValue(20.0)
                          .build())
        .build()

    chartSurface.renderableSeries.add(pieSeries)
}

The SciPieChartSurface is inside a CardView inside a Constraintlayout if that could matter:

<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">   

    <android.support.v7.widget.CardView
        android:id="@+id/card_chart"
       android:layout_width="match_parent"
       android:layout_height="match_parent" >

        <com.scichart.charting.visuals.SciPieChartSurface
            android:id="@+id/chart"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
    </android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>
1 vote
4k views

I am trying to listen changes in pie chart segment selections. I am adding the listener like so:

piesegment.addChangeListener { changedSegment in
    print("changed selection \(changedSegment.isSelected)")
 } 

The closure is never called however. My first question is: Is this the right way of doing this? In Android I implement the PieSegmentChangeListener interface and do an addIsSelectedChangeListener on the segment. In ios the SCIPieSegmentChangeListener is not a protocol. My second question is: How can I create a my own listener like in android and add it to the segment?

By the way support should not be exired!!!!

0 votes
12k views

I would like to be able to have a Pie Chart go to the very edge of the layout it’s inside. Currently it appears as though there is some default built-in padding around Pie Charts that cannot be overridden. I’ve tried manually specifying padding and margins both programmatically (on the SciChartSurface object itself) and in the layout XML, but that default padding still exists.

I’ve included a screenshot of the sample app to show the padding I’m talking about (circled in red).

1 vote
5k views

Hi,
I’m trying to synchronize the pie chart and the line chart in React. I’ve already done this for two line graphs.

They both use the same data table. And I want to know if it’s possible, if when I zoom in on the line chart, it updates the Pie chart with the new range.

Thanks, (sorry for my english ^^)

  • thier tom asked 1 year ago
  • last active 1 year ago
0 votes
8k views

I’m trying to create a Modifier for a PieChart Surface. I can not figure out how to get a segment for a point on the screen. With SciChartSurface, you can get the axis, and use its calculator to get a datapoint, or pixel point. Is there something similar in SciPieChartSurface?

1 vote
5k views

How can I format the percentage values in the pie chart segments to omit the decimals? e.g i want it to show 20% instead of 20.00%. The values I pass in are always rounded

0 votes
7k views

Is there a way to provide custom text for the labels in a PieChartSegment? I want to format the text, but haven’t been able to find a label formatter for the pie charts.

0 votes
10k views

Hey Guys,

I have a requirement where I need to show Donut Chart Title , but adding any annotation is crashing my application.

    let textAnnotation = SCITextAnnotation()
    textAnnotation.coordinateMode = .relative
    textAnnotation.x1 = SCIGeneric(0.5)
    textAnnotation.y1 = SCIGeneric(0.5)
    textAnnotation.horizontalAnchorPoint = .center
    textAnnotation.verticalAnchorPoint = .center
    textAnnotation.text = "Test"
    textAnnotation.style.textStyle.fontSize = 14
    textAnnotation.style.textColor = UIColor.fromARGBColorCode(0xff000000);
    textAnnotation.style.backgroundColor = UIColor.clear
    chartSurface.annotations = SCIAnnotationCollection(childAnnotations: [textAnnotation])

Thanks

0 votes
9k views

Hello,

I want to use the MultiplePieDonutChart. Like in the example, I want to have a touch tooltip.
I tried it with that code:

LinearLayout chartLayout = (LinearLayout) root.findViewById(R.id.chart_layout);
SciChartLegend legend = root.findViewById(R.id.pieChartLegend);

    chartLayout.addView(surface);

    SciChartBuilder.init(MainMenu.getActivity());

    final SciChartBuilder sciChartBuilder = SciChartBuilder.instance();

    final IPieRenderableSeries pieSeries = sciChartBuilder.newPieSeries().withSeriesName("HowPeopleTravel").withSegments(
            sciChartBuilder.newPieSegment().withValue(34).withTitle("Ecologic").withRadialGradientColors(0xff84BC3D, 0xff5B8829).build(),
            sciChartBuilder.newPieSegment().withValue(34.4).withTitle("Municipal").withRadialGradientColors(0xffe04a2f, 0xffB7161B).build(),
            sciChartBuilder.newPieSegment().withValue(31.6).withTitle("Personal").withRadialGradientColors(0xff4AB6C1, 0xff2182AD).build()
    ).build();
    final IPieRenderableSeries donutSeries = sciChartBuilder.newDonutSeries().withSeriesName("DetailedGroup").withSegments(
            sciChartBuilder.newPieSegment().withValue(28.8).withTitle("Walking").withRadialGradientColors(0xff84BC3D, 0xff5B8829).build(),
            sciChartBuilder.newPieSegment().withValue(5.2).withTitle("Bicycle").withRadialGradientColors(0xff84BC3D, 0xff5B8829).build(),
            sciChartBuilder.newPieSegment().withValue(12.3).withTitle("Metro").withRadialGradientColors(0xffe04a2f, 0xffB7161B).build(),
            sciChartBuilder.newPieSegment().withValue(3.5).withTitle("Tram").withRadialGradientColors(0xffe04a2f, 0xffB7161B).build(),
            sciChartBuilder.newPieSegment().withValue(5.9).withTitle("Rail").withRadialGradientColors(0xffe04a2f, 0xffB7161B).build(),
            sciChartBuilder.newPieSegment().withValue(9.7).withTitle("Bus").withRadialGradientColors(0xffe04a2f, 0xffB7161B).build(),
            sciChartBuilder.newPieSegment().withValue(3.0).withTitle("Taxi").withRadialGradientColors(0xffe04a2f, 0xffB7161B).build(),
            sciChartBuilder.newPieSegment().withValue(23.2).withTitle("Car").withRadialGradientColors(0xff4AB6C1, 0xff2182AD).build(),
            sciChartBuilder.newPieSegment().withValue(3.1).withTitle("Motorcycle").withRadialGradientColors(0xff4AB6C1, 0xff2182AD).build(),
            sciChartBuilder.newPieSegment().withValue(5.3).withTitle("Other").withRadialGradientColors(0xff4AB6C1, 0xff2182AD).build()
    ).build();

    Collections.addAll(surface.getRenderableSeries(), pieSeries, donutSeries);
    Collections.addAll(surface.getChartModifiers(), sciChartBuilder.newLegendModifier(legend).withShowCheckBoxes(false).withSourceSeries(pieSeries).build(), new PieChartTooltipModifier());

But if I touch on the chart I didn’t get the tooltip. As you see I have nearly copy all the code of the Example but I do not work. Where is my fault?

Showing 16 results

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies