wxIshiko / wxCharts

A library to create charts in wxWidgets applications
https://www.wxishiko.com/wxCharts/
MIT License
126 stars 50 forks source link

Popup Window on StackedColumnChart #168

Open gismowdd opened 4 years ago

gismowdd commented 4 years ago

When you have a lot of datasets (I have 13) the black popup window that appears when you hover the mouse above a bar doesn't stay above the bottom of the chart control window. I would like the top of the black window to be just below the top of the chart control window which would allow the user to see the the black window and the most of the bars simultaneously. Also, how do you control the precision of the numbers appearing in the black box? I need something like a Format f6.2. I only need 2 decimal places.

Kvaz1r commented 4 years ago

This popup window is a tooltip. I'm not sure that possible to do what you want, but you can try set align for tooltip as wxALIGN_TOP:

    wxChartsDefaultTheme->GetStackedColumnChartOptions()->GetCommonOptions().
        GetMultiTooltipOptions().SetAlignment(wxALIGN_TOP);

Also, how do you control the precision of the numbers appearing in the black box? I need something like a Format f6.2. I only need 2 decimal places.

I think provide option for setting different formatting for tooltip data would be good addition.

gismowdd commented 4 years ago

Hi Kvaz1r , Yeah wxALIGN_TOP aligned the bottom of the tooltip to the top of the bar which works great for the short stacks but the tooltip tops on the tall stacks can't be seen. wxALIGN_RIGHT, wxALIGN_LEFT and wxALIGN_BOTTOM all put the tooltip in the upper left side of the chart window but the entire tooltip was not visible. I thought maybe it had something to do with padding so I changed: wxChartsDefaultTheme->GetStackedColumnChartOptions()->SetPadding(wxChartPadding(left,right,top,bottom));

I'm still not sure what padding does because I never saw any changes to the chart when I changed the values.

I think I'm going to have to either accept the tool tip the way it is or just turn it off. I hate just turning it off since I think it's really cool.

Kvaz1r commented 4 years ago

I'm still not sure what padding does because I never saw any changes to the chart when I changed the values.

As far I understand padding only used for inner borders for labels.

I think I'm going to have to either accept the tool tip the way it is or just turn it off. I hate just turning it off since I think it's really cool.

Maybe as first step to custom tooltip it would be possible to provide redirect tooltip method and simple panel wrapper. In that case it could be set into any position as separate widget. But I've never look at tooltip part code of the library because I use tooltip only for piechart so I can't say does the idea really have sense.