Display column keys of stacked bar chart vertically in jFreeCharts - jfreechart

I am developing a javaEE application using jfreecharts. I successfully displayed my data using a stackedBarChart but the column keys (Y-axis labels) are not fully displayed because they are too large. how can I display them vertically? thanks for your suggestions

You can use setCategoryLabelPositions() like they show here.
CategoryPlot plot = (CategoryPlot) chart.getPlot();
CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90));

Related

AmCharts4 disable radar chart resize/zoom

I have this AmCharts4 radar chart in my react application is there any way to disable the click-drag zooming?
Thx.
Image of the chart
Assuming you're referring to the zoom from the chart cursor, you have to set the cursor object's behavior to "none":
chart.cursor = new am4charts.RadarCursor();
chart.cursor.behavior = "none";
You can find a list of valid properties in the linked documentation and in this tutorial.

Google Data studio-Customised BarChart Tooltip

I have created bar chart using Google data studio. Now I have to add a dimension values(For each BookingCategory in chart we have different agents. So I want to display Agents with there booking count in each bar Tooltip) on the tooltip of the barchart.
Is this Feasible to achieve ?
You can show bookings by agent in your bar chart by adding it as a secondary/breakdown dimensions and selected "stacked" in the style menu.
Hopefully I've understood your question correctly!

Extjs 5.0.0 bar chart series label issue

I am not able to display bar chart series label horizontally outside the bars.
Used display:'outside' and orientation:'horizontal' for bar chart label configuration, still no results.
Is it a bug in 5.0.0 or is there any other way to display label horizontally ?

Extjs Charts: remove as series using chart.series.getAt(0) how?

Hello how can I remove a series from a chart, I know that I can get the series object using getAt(0) or getAt(1) depending on how many serieses I got in my chart.
my question is how can I remove a series from the chart.
main reason is that I give the end user the ability to change the series type: bar, line... so I wan to display the new change at run time by removing the series and adding a new one.
I tried Chart.series.removeAt(0); It removes the legend but the bar or the line still shown !!
I use extjs 4.1.1
thank you,
I had to do the same thing and give end users the ability to change the chart type at run time to give different visualizations of data. I found that there is more involved in the chart type (bar, line, pie) then just the series. In other words to achieve this, I wasn't able to just substitute a different series type for the data and add it to the chart.
I ended up creating a different config for each different type of chart using the same datastore. The chart was contained by an Ext.panel.Panel which I added this function to:
// toggle format between pie chart and bar chart
this.toggleFormat = function() {
var chart = me.down('chart');
this.remove(chart);
if (chart.chartType == 'pie') {
this.add(Ext.create('Ext.chart.Chart', bar));
} else {
this.add(Ext.create('Ext.chart.Chart', pie));
}
};
The bar variable holds a bar chart config and pie holds a pie chart config but both had the same datastore attached to their store: configs.
When the user pressed the format button I called this function to remove the chart from the panel and create one with the different format. It achieved the desired effect.

JFreeChart - mark a border between stacked bar components

I am using jfreechart stacked bar and instead of colors I would like only to mark the borders between the components with a black line . is that possible?
Thanks.
Assuming that you have two series, set DrawBarOutline to true and then set the SeriesOutlinePaint
StackedXYBarRenderer renderer = new StackedXYBarRenderer(0.10);
renderer.setDrawBarOutline(true);
renderer.setSeriesOutlinePaint(0, Color.BLACK);
renderer.setSeriesOutlinePaint(1, Color.BLACK);

Resources