[SOLVED] Pie Chart Colors

Description
steger
Posts: 2
Joined: Fri Apr 12, 2019 6:47 am

[SOLVED] Pie Chart Colors

Postby steger » Fri Apr 12, 2019 6:51 am

Hello,

I used velocity to create a pie chart. How I would like to change the default colors. How do I do this?

This is my test code:

Code: Select all

#set($html = $renderingContext.createHtmlFragmentBuilder())
#set($chart = $renderingContext.createChartBuilder())
#set($pie = $chart.pie())
$!pie.addValue("test a", 5).null
$!pie.addValue("test b", 10).null

$!chart.build().title().text("Test test").null
$!chart.build().plotOptions().pie().addRawAttribute("tooltip", "{pointFormat: '<b>{point.y}</b>'}").null
$!chart.build().plotOptions().pie().addRawAttribute("colors", "{colors: ['#000000', '#0d233a', '#8bbc21', '#910000', '#1aadce']}").null



I assume this line should/could do the job:

Code: Select all

$!chart.build().plotOptions().pie().addRawAttribute("colors", "{colors: ['#000000', '#0d233a', '#8bbc21',


Thanks for your answers.
Last edited by steger on Wed Apr 17, 2019 7:33 am, edited 1 time in total.

mhoe
Posts: 29
Joined: Tue Nov 29, 2016 3:30 pm

Re: Pie Chart Colors

Postby mhoe » Mon Apr 15, 2019 7:25 am

Hi steger,

this should do the job:

Code: Select all

#set($pieceOfCake = $!pie.addValue("test a", 5))
$!pieceOfCake.color('red').null

steger
Posts: 2
Joined: Fri Apr 12, 2019 6:47 am

Re: Pie Chart Colors

Postby steger » Wed Apr 17, 2019 7:32 am

This works fine

Thanks


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: Brantpync and 9 guests