Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support custom widget for titles #183

Closed
yoonsio opened this issue Jan 27, 2020 · 4 comments
Closed

support custom widget for titles #183

yoonsio opened this issue Jan 27, 2020 · 4 comments
Labels
enhancement New feature or request Fundamental

Comments

@yoonsio
Copy link

yoonsio commented Jan 27, 2020

support custom widget for titles by returning Widget in getTitles

Maybe we can use WidgetSpan in place of TextSpan.
https://api.flutter.dev/flutter/painting/InlineSpan-class.html

old:

getTitles: (double value) {
  return value.toString();
},

new:

getTitles: (double value) {
  return Text(value.toString());
},
@imaNNeo imaNNeo added enhancement New feature or request Fundamental labels Feb 7, 2020
@vintage
Copy link

vintage commented Mar 5, 2020

@imaNNeoFighT Is there any known workaround on how to display custom widget or at least image as title? I've got a chart which display mood changes over time and the titles are not text-based unfortunately - these are custom widgets, but could workaround it with some dummy images if that's somehow possible.

@imaNNeo
Copy link
Owner

imaNNeo commented Mar 5, 2020

We don't have any built-in solution for this,
but we are trying to find a proper way to do that.

@imaNNeo
Copy link
Owner

imaNNeo commented Feb 18, 2022

Some samples from #215:

imaNNeo added a commit that referenced this issue Feb 18, 2022
Allow to return a Widget in SideTitles.getTitles instead of a `String`. For example, you can pass an Icon widget as a title, #183.
@imaNNeo imaNNeo mentioned this issue Feb 18, 2022
5 tasks
imaNNeo added a commit that referenced this issue Mar 6, 2022
Allow to return a Widget in SideTitles.getTitles instead of a `String`. For example, you can pass an Icon widget as a title, #183.
imaNNeo added a commit that referenced this issue Mar 23, 2022
Allow to return a Widget in SideTitles.getTitles instead of a `String`. For example, you can pass an Icon widget as a title, #183.
imaNNeo added a commit that referenced this issue Mar 23, 2022
Allow to return a Widget in SideTitles.getTitles instead of a `String`. For example, you can pass an Icon widget as a title, #183.
imaNNeo added a commit that referenced this issue Mar 23, 2022
Allow to return a Widget in SideTitles.getTitles instead of a `String`. For example, you can pass an Icon widget as a title, #183.
imaNNeo added a commit that referenced this issue Mar 23, 2022
Allow to return a Widget in SideTitles.getTitles instead of a `String`. For example, you can pass an Icon widget as a title, #183.
imaNNeo added a commit that referenced this issue Mar 23, 2022
Allow to return a Widget in SideTitles.getTitles instead of a `String`. For example, you can pass an Icon widget as a title, #183.
imaNNeo added a commit that referenced this issue Mar 23, 2022
Allow to return a Widget in SideTitles.getTitles instead of a `String`. For example, you can pass an Icon widget as a title, #183.
imaNNeo added a commit that referenced this issue Mar 23, 2022
Allow to return a Widget in SideTitles.getTitles instead of a `String`. For example, you can pass an Icon widget as a title, #183.
imaNNeo added a commit that referenced this issue Mar 23, 2022
Allow to return a Widget in SideTitles.getTitles instead of a `String`. For example, you can pass an Icon widget as a title, #183.
imaNNeo added a commit that referenced this issue Mar 24, 2022
Allow to return a Widget in SideTitles.getTitles instead of a `String`. For example, you can pass an Icon widget as a title, #183.
imaNNeo added a commit that referenced this issue Mar 24, 2022
Allow to return a Widget in SideTitles.getTitles instead of a `String`. For example, you can pass an Icon widget as a title, #183.
@imaNNeo
Copy link
Owner

imaNNeo commented Mar 25, 2022

Heeey guys. What's up?
We have an important update in 0.50.0.
At this time, we support widgets as titles instead of a boring string.
Don't forget to check out the migration guide. Because there are some breaking changes.

I tried to implement two samples. check them out:

LineSample8:
line_chart_sample_8

BarSample7:

@imaNNeo imaNNeo closed this as completed Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Fundamental
Projects
None yet
Development

No branches or pull requests

3 participants