Closed workingbuddy10 closed 1 year ago
I think the easiest way to do this would be to create a custom theme and override things set in StockChartDefaultTheme, for example:
const myTheme = am5.Theme.new(root);
myTheme.rule("RoundedRectangle", ["legend", "itemcontainer", "background", "stocklegend"]).setAll({
fillOpacity: 0
});
myTheme.rule("Container", ["legend", "itemcontainer", "stocklegend"]).setAll({
paddingRight:0,
paddingTop:0,
paddingBottom:0,
paddingLeft:0
});
root.setThemes([
am5themes_Animated.new(root),
myTheme
]);
https://codepen.io/team/amcharts/pen/GRwzpXd/f5a97bb37034fbae07a0bbbd48bd3905?editors=1010
Thanks that box removal part worked, but still there is a change left. Like removal of the space. Marked in the red circle. @zeroin
The space is added because labels, icons have padding. You can either modify padding for all elements or simply set some negative paddingTop for your itemContainer.
Thanks it worked.
I want to customization in the legend.
1) I don't want that legend box/container.
2) I want to remove the space, marked with red in the image. As I am displaying multiple charts so space is an important factor.
Image:
Code for legend: