675
Views
6
Comments
Solved
Legend Pie Chart
Question

HI all,, 

how to create a pie chart as below



2018-06-04 13-39-03
Margarida Morais
Solution

Hi Hothorasman,

You can format charts by applying jason to the AdvancedFormat property. 

I found the code for your chart here. You can find all the code you need to edit your charts in the HighCharts api or in the Highcharts demo section.

To add the jason you only have to asign the code to the AdvancedFormat structure and apply the AdvancedFormat_Init function. Check the oml to understand better how you can do it.



ToDo.oml
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Hothorasman,

That looks lke a pretty standard pie chart. Did you take the online courses? Did you read the documentation on charts in OutSystems? Is there something specific about the pie chart you don't know how to create?

2019-03-03 13-55-42
Hothorasman Panjaitan

Hi Kilian

I just Found Legend position,,as capture below

can you help me..?

2018-06-04 13-39-03
Margarida Morais
Solution

Hi Hothorasman,

You can format charts by applying jason to the AdvancedFormat property. 

I found the code for your chart here. You can find all the code you need to edit your charts in the HighCharts api or in the Highcharts demo section.

To add the jason you only have to asign the code to the AdvancedFormat structure and apply the AdvancedFormat_Init function. Check the oml to understand better how you can do it.



ToDo.oml
2021-06-28 14-36-12
Rafi Ahmed khan

Hi Hothorasman,

You can achieve the same functionality with the use of High charts script.

you just need to only populates the data series with data , which you can create in OutSystems as datapointlist and datapoints, After creating data series , put in SourceDataPointList property. 

Now , on Advanced Format - copy below code for css and legeds design.

SyntaxEditor Code Snippet

AdvancedFormat_Init(DataPointFormats:,DataSeriesFormats:,XAxisJSON:,YAxisJSON:,HighchartsJSON:"
    chart: {
        plotBackgroundColor: null,
        plotBorderWidth: null,
        plotShadow: false,
        type: 'pie'
    },
    title: {
        text: 'Browser market shares in January, 2018'
    },
    tooltip: {
        pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
    },
    plotOptions: {
        pie: {
            allowPointSelect: true,
            cursor: 'pointer',
            dataLabels: {
                enabled: true,
                format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                style: {
                    color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                }
            }
        }
    },
    series: [{
        name: 'Brands',
        colorByPoint: true,
        data: [{
            name: 'Chrome',
            y: 61.41,
            sliced: true,
            selected: true
        }, {
            name: 'Internet Explorer',
            y: 11.84
        }, {
            name: 'Firefox',
            y: 10.85
        }, {
            name: 'Edge',
            y: 4.67
        }, {
            name: 'Safari',
            y: 4.18
        }, {
            name: 'Sogou Explorer',
            y: 1.64
        }, {
            name: 'Opera',
            y: 1.6
        }, {
            name: 'QQ',
            y: 1.2
        }, {
            name: 'Other',
            y: 2.61
        }]
    }]
")

the final Output will be :

Cheers..

Rafi 



2018-06-04 13-39-03
Margarida Morais

Hi Rafi,

You can Map the local storage to populate the chart.

You only have to add this to the advanced format:


"plotOptions: {
        series: {
            dataLabels: {
                enabled: true,
                format: '{point.name}: {point.percentage:.1f}%'
            }
        }
    },"

Cheers,

Margarida

2017-09-14 14-44-07
Romeo Mlinar
Staff

In addition to the great posts above, here is a tutorial on how to generate sample data and create charts in OutSystems.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.