Changing the x labels in a Liferay 7.2 barchart - liferay

I'm trying to display a bar chart following this example in Liferay 7.2; https://help.liferay.com/hc/en-us/articles/360028832612-Bar-Charts. It works fine but is there a way to change the labels of the "X" axis from "0, 1, 2" to something else?

Please try this:
_barChartConfig.getAxisX().setType(AxisX.Type.CATEGORY);
_barChartConfig.getAxisX().addCategories(myCategories);
Where myCategories is a List object with the labels you'd like to display under each bar.

Related

Chart Missing Observations

I'm having trouble with a combination chart. I'm using the old-school chart because same vis in the Legacy Visualizations and New Visualizations forces a second values axis with a different scale on the right. I don't want that.
The trouble I'm having is that not all of the observations are showing up. I have a page with a chart and a list. Both use the same query, but some observations are missing from the chart.
[MATSLabNumberNumeric] = cast ( substring ( [MATS Lab Number], 6 ), int ) where MATS Lab Number is like FA0200088 (for the first observation in the list). All observations are displayed if the MATS Lab Number is used, but not if MATSLabNumberNumeric is used.
I tried resizing the chart, but as expected, changing the layout had no effect on the data being presented. It just made the columns wider or narrower.
I have had the same results in all combinations of these:
Cognos Analytics 11.0.13
Cognos Analytics 11.1.7
Interactive Viewer
Compatible Viewer
11.4 styles
10.x styles
combination chart
bar chart
column chart
area chart
line chart
Any idea what could be causing this? Is there a property I inadvertently flipped?
You can try adjusting the width of the chart under the Size and Overflow property.

How to change the % on top each bar to just number?

I want to change the % to just number on top of each bar. For example, 62.0% would just be shown as 62. What "custom format code" would I need to put in for this ? I would really appreciate if anyone could help with this
I'm not sure what the names are in English but "label alternatives" perhaps?
Look at the image and click on the correct buttons and I guess you will get there.
Where the arrow is you can customize the labels how you want.
Or if that fails you might have to change the values in the table that the chart is connected to.

Change Background color of column in grid dynamically

Hi I don't know how to dynamically change the background color of the column inside the grid I tried looking here Changing column name dynamically but failed. I also tried looking for something like change but only changing of display name is applicable.
PXUIFieldAttribute.SetDisplayName<PMTran.description>(Base.Transactions.Cache,
row.ProjectID.HasValue ? "Description for Project Tran" : "Description");
Check this out for the answer:
How to change the cell colors

Change color of data label placed, using the 'best fit' option, outside a pie chart - Excel 2010

I am working with a pie chart whose data labels are added using the best fit property. Most of those labels are placed by Excel inside the pie, but some of them are placed outside.
Because of some series colors are so strong, the data labels had to be defined as white. Of course, the labels placed outside the pie wont be visible if I don't manually change their color (to black, for instance)
What I am trying to do is to conditionally change the label's color according to where Excel placed it (white inside the pie, black outside it), as in the following image:
I have been searching for a solution, but it seems that nobody had a similar problem.
Does anyone know if Excel allows this or does someone know a trick to bypass it?
There is a way to do this in Excel.
When you click on the chart, and go to Layout under Chart Tools.
Once there, go to Data Labels.
When you click on that, it will display a drop-down menu. At the bottom of the menu, click on More Data Label Options.
It will pull up a new window. On the sidebar of the new window, click on Number.
Then, under Category click on Custom.
In the textbox shown under Format Code, type in [Black][<0.05]0%;[White][>=0.05]0%
Click Add.
It should format the numbers outside the pie chart in your example black, and the numbers inside the pie white. If you had different data, you could format it the same, but you would have to change the number in the brackets after the color to the number one higher than number outside of the pie. It would be like this: [Black][<(number one higher than number outside of the pie)]0%;[White][>=(number one higher than number outside of the pie)]0%
Screenshot of Pie Chart Formatting
Source:
http://chandoo.org/wp/2009/01/29/colors-in-excel-chart-labels-trick/

PerformancePoint stacked bar

I'm trying to get a report with stacked bars in the panel PerformacePoint control.
I have 3 sets and want to get version reaching the target visually.
If I use a bar graph, and use a value formatted as%, first, it works. But when you step to the line with stacked bar disappears objectives. Any idea? Is it possible?
Thanks

Resources