Dynamicreports: Remove black border wrapped legend - jfreechart

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的黑线框
}

Related

Remove hover legend/logog icon from Candlestick hover text

I am using a candlestick plot and I would like to remove the icon on the left from the hover label. Is there a way to achieve this?
I would like to remove this

React Native tabBarItemStyle width not working

I have been working on a Bottom Tab Navigator and try to make tab bar items being highlighted with a circle shape around the icon when they are selected. I tried to set the height and width inside tabBarItemStyle, however, only height changes while width does not change. Is there something else I missed? How can I set the width so that the highlighted part is in a circle shape?
Here is a demo of the tab bar I am working on.
https://snack.expo.dev/qLi7s9qAA
The issue is because the width value is being overridden by the containers flexbox property.
A quick easy fix is to use the maxWidth property instead of width in tabBarItemStyle properties.
There's a nice article here: https://mastery.games/post/the-difference-between-width-and-flex-basis/ that explains it.

ChartJS distinguish clicks between chart area, dataset and legend

I have a react app that uses ChartJS through 'npm react-chartjs-2'.
I am working with a Line chart and I a have the following requirements:
1- Detect clicking on chart area (white area; other than data set line, and legend), then do some logic
2- Detect clicking on legend rectangle at the top to hide/show the dataset (current default behaviour)
I have tried using options.onClick but it seems to override legend click.
Also tried getElementAtEvent it returns the dataset clicked on but when clicking on legend/chart area comes as empty. getDatasetAtEvent always return empty array. And if I use options.legend.onClick I loose default hide/show behaviour and need to do it programmatically.
I was wondering is there is a better way to achieve requirements above. Thanks
You can use the getElementsAtEvent property. This gives value only when the chart area is clicked, the element is null if it is clicked on the legend. If it is clicked on the chart area then it holds properties from which we can get the clicked xAxis and legend value.
document.getElementById("yourChartCanvasId").addEventListener("click", function (e) {
var element = instance.getElementsAtEvent(e)[0];
if (element) {
//Handle click on chart area
}
else {
//Handle click on legend area
}
});
Also if you don't want to do anything on legend click, keeping the default Chart.js behavior then don't include the else block.

Preventing bleedthrough of colours on transparent TabNavigator component

I was having a problem rendering text in a TabNavigator with a transparent TabBar, because I wanted to show the background Image. That image was mostly red, and I wanted pure white text for the labels, but they were coming out pink. The problem was that RN was blending then background colour with the text colour. Essentially, RN was not giving the text view 100% opacity.
To fix this, I added
backgroundColor: '#ffffff00',
opacity:100
to tabStylein tabBarOptions.

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