JFreeChart - mark a border between stacked bar components - jfreechart

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);

Related

How to use custom label color logically to a row chart in dc.js using ReactJS

How to use custom label color to a row chart in dc.js
my requirement is to show green and red color on the basis of some logical condition. I have tried 'pretransition' but not understand how to use it.
Can someone help me regarding this below is my code for rowchart.
Thanks in advance.
chart
.width(768)
.height(480)
.elasticX(true)
.label(function(d) return d.label)
.dimension(runDimension)
.group(speedSumGroup)
.render();

How to create multilines legend in Data Studio

In Data Studio my 10 points pie chart is like below:
As you can see there is a navigation arrow in the legend at the top of the pie.
I wonder how can I avoid the navigation by creating the multiline legend? How can I wrap the current single line legend?
Three ways to display all items in the legend; located in the Style Tab of the Pie Chart (added a GIF to elaborate):
Increasing the max lines;
Increasing the width of the Pie Chart;
Reducing the font size of the legend.
EDIT: Multi line Legend (Workaround using a Bar Chart)
How about using the legend from a Bar Chart? Added a GIF to elaborate as well as a few points:
Bar Chart: Use a Dimension and Breakdown Dimension that's the same as the one on the Pie Chart and enable the legend (Top) as well as using 2 lines (no legend for the Pie Chart)
Shape: Add a Shape over the Bar Chart (one that blends in with the background)
Order: Right click on components and select Order from the drop down to change the order of the components (Bar Chart: Send to back; Shape: Send Backwards (behind the Pie Chart); Pie Chart: Bring to Front)
Fine Tuning: Use Shift + Movement for precision placement (to get the shape exactly where you want it)

Dynamicreports: Remove black border wrapped legend

I am using dynamicreports4.1.1
When I draw barCharts, I want to remove the black border wrapped the legend,
but not remove the total legend.
I tried to customize the chart render but failed, I can't find what properties it use.
LegendTitle legend = chart.getLegend();
//necessary when some set showLegend=false
if(legend!=null){
legend.setFrame(BlockBorder.NONE);//去除legend的黑线框
}

Display column keys of stacked bar chart vertically in jFreeCharts

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));

How to show tooltip on MS Chart

I am using MS Chart control to draw graphs on Winform.
I want to show the current (x,y) Value as tooltip on Mousedown on chartarea.
How do I do that?
From the chart samples (Samples Environments for Microsoft Chart Controls)
// Set ToolTips for Data Point Series
chart1.Series[0].ToolTip = "Percent: #PERCENT";
// Set ToolTips for legend items
chart1.Series[0].LegendToolTip = "Income in #LABEL is #VAL million";
// Set ToolTips for the Data Point labels
chart1.Series[0].LabelToolTip = "#PERCENT";
// Set ToolTips for second Data Point
chart1.Series[0].Points[1].ToolTip = "Unknown";
This tooltip will appear on mouseover. I'm not sure if you can set it for mousedown event.
Chart1.Series["Series1"].ToolTip = "#VALY, #VALX";
If you want to show tooltips with maximum and minimum values in Range type charts, the following code can be used.
Chart1.Series["Series1"].ToolTip = "Min:#VALY1, Max:#VALY2";

Resources