Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Showing legends and values on particular point - Stacked area chart #770

Open
elmar001 opened this issue May 21, 2022 · 1 comment
Open

Comments

@elmar001
Copy link

How to show legends of stacked area chart? Is it possible? And also is there a way to show values when user clicks on specific part of stacked area chart.

@elmar001
Copy link
Author

Ok, I found the way for legends:
behaviors: [
new charts.SeriesLegend(
// Positions for "start" and "end" will be left and right respectively
// for widgets with a build context that has directionality ltr.
// For rtl, "start" and "end" will be right and left respectively.
// Since this example has directionality of ltr, the legend is
// positioned on the right side of the chart.
position: charts.BehaviorPosition.end,
// For a legend that is positioned on the left or right of the chart,
// setting the justification for [endDrawArea] is aligned to the
// bottom of the chart draw area.
outsideJustification: charts.OutsideJustification.endDrawArea,
// By default, if the position of the chart is on the left or right of
// the chart, [horizontalFirst] is set to false. This means that the
// legend entries will grow as new rows first instead of a new column.
horizontalFirst: false,
// By setting this value to 2, the legend entries will grow up to two
// rows before adding a new column.
desiredMaxRows: 2,
// This defines the padding around each legend entry.
cellPadding: new EdgeInsets.only(right: 4.0, bottom: 4.0),
// Render the legend entry text with custom styles.
entryTextStyle: charts.TextStyleSpec(
color: charts.Color(r: 127, g: 63, b: 191),
fontFamily: 'Georgia',
fontSize: 11),
)
],

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant