Fixed defined color in the diagram - oracle-apex

In a bar chart I display two values. OK and Not_OK. Only the bar of OK is displayed in red and the bar of Not_OK in green. I have the feeling APEX assigns color by chance. Can I define the color for the respective value?

You can define the color in the series of your chart. I have built a sample application you can see here.
If both bars are defined in the same series, you can create a column for the color, then reference that column in Color field of the series. If the two bars are defined in different series, you can use the same method, or select a color to use for that series.

Related

Chartjs: customise legend based on background color

I am creating a bar chart using charts. The current work is below:
The colour represents continents. Notice that the default legend is blue showing undefined. I want to have the legends showing each colour and its represented continent. That is, to be able to display legends of the bar's background and customise their label.
How can I achieve that?
Really appreciate your help! Thanks
Instead of putting all your data in a single dataset you will need to make a different dataset for each continent and then set the label of that dataset to the continent

Chart JS: Bar Chart to have min Length as value range is too big

I working with ChartJS Bar chart, encountered that small value were not drawn when the value range is too huge.
example [1000,500000000,40000]
This case the chart will only draw out the 500m, and they rest are hidden.
I want show all instead of limiting my max tick.
Did a deeper reading. there's a property called minBarlengh undter dataset. This did the trick.

Why do Bar Pie Chart values not line up?

I'm working on a Bar Pie Chart but my values are not lining up. For example, Red data is clearly larger then blue, but blue value is higher.
The data is correct, chart.js doesnt show the area as more, it uses the angle of the circle , which normally would also divede the area normally. And as you can see the angles are correct so to fix your issue you will have to write a custom controller that draws your chart. https://www.chartjs.org/docs/latest/developers/charts.html

Apply different different data colors to different charts in power bi theme creation

I am using PowerBi February release.
I am trying to create custom theme (.json file). I want to have different data colors for different charts and not the global/common data colors for all charts.
Suppose for line chart colors are "red,green,blue" then for pie chart colors are different, lets say "yellow,grey,purple".
Can you please suggest how to create a theme based on above requirement.
Thanks in advance
Currently, this is not possible to create a custom theme that pre-assigns each color to a bar or piece of a pie chart. You can for KPI and some of the other visuals, but not pie or bar (aka stacked column chart)
The current workaround is very easy though. Follow these steps:
1) As suggested by this blog, create a custom theme with your desired colors. Using this online tool, I was able to make a minimum theme file from your requirements:
{
"name":"MyTheme1",
"dataColors":["#ff5624", "#21ff13", "#0009db", "#fff780", "#d3d3d3", "#7d00b6"]
}
2) Save this as yourtheme.json and import the file in the Ribbon using Themes->Switch Theme->Import Theme
3) Then you would need to go to the bar chart and pie visual and assign the colors individually:
For the Pie Chart - click the paint roller found in the visualizations pane and expand Data Colors. Then assign the color to the values for each pie piece. (see image for the colors from your theme.)
For bar chart (aka stacked column chart) click the paint roller found in the visualizations pane and expand Data Colors. Then set the Show All setting to On. Then assign the color to the values for each bar.
The image below is a power bi report with bar and pie charts colored with the colors from your imported theme file.

How to change the percentage to different color

I am doing a google chart that displays percentage data.
I have got it working already.
The question is the percentage displayed on the chart is white in color which cant be seen clearly. How can i change the color of it to black and if possible individual color for each section.