-
Notifications
You must be signed in to change notification settings - Fork 566
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
Question: Tooltip, Corss, Indicator Label does not shown if Tooltip component is not turned off/on in inspector. #315
Comments
Well, i think indicator label with 'dynamic axis split number when zooming' problem solved. Changed some code in TooltipHandler.cs : private void SetTooltipIndicatorLabel(Tooltip tooltip, Axis axis, ChartLabel label)
{
...
if (axis.IsCategory())
{
// Old
//var index = (int)axis.context.pointerValue;
//var category = axis.GetData(index);
//label.SetText(axis.indicatorLabel.GetFormatterContent(index, category));
// Edited
var index = (int)axis.context.pointerValue;
var dataZoom = chart.GetDataZoomOfAxis(axis);
var category = axis.GetData(index, dataZoom);
label.SetText(axis.indicatorLabel.GetFormatterContent(index, category));
}
...
} But still, can't make Tooltip Indicator Labels show itself without turning on/off Tooltip component. Any ideas? |
Also, it seems that Indicator labels and labels of axis cannot be disabled by just un-ticking active component, you must change at least some value inside component (for example sprite color) from default to custom, otherwise enabling/disabling component will not do anything. Tested on 'background' settings of indicatorLabel of axis. |
Hi again! Same problem: can't make Tooltip Indicator Labels show itself without turning off/on Tooltip component in inspector. My Tooltip is set to Corss. When tooltip component is initialized, Tooltip type becomes 'Line', and updates to Corss only later. I ended up adding label object manually. Even tho it's spaghetti code, tooltip indicator labels is shown without need for turning on/off Tooltip component in inspector. |
I'm unable to replicate the issue you've described. Could you please provide detailed steps to reproduce it? |
You should try to instantiate prefab containing chart, because when i tried to replicate issue for you, i found out that even tho examples work fine, when i try to pack example script into prefab and instantiate it later, this issue with 'labels not showing' comes up (it seems that indicator line style color and other components will not be set properly either). So, it seems that if chart script exists in scene before play mode - all work as intended, but if you instantiate it later at runtime - issue comes up. I'm using XCharts version 3.10.2 in my project, but same issue exists in demo project. Steps to replicate:
|
The issue has been fixed in version 3.11.0. |
I think something is wrong with 'AxisHandler.UpdatePointerValue()' or pointer value does not get updated after i manually change axis split number, depending on xDataZoom current data quantity.
Screenshot
Also, please help me understand behaviour of indicator labels on axises when tooltip is set to Corss mode.
Problem is, when tooltip in Corss mode, indicator labels are hidden, even thought they are enabled on axises.
Indicator Labels Hidden (Play-mode)
But if i disable and than enable Tooltip (Play-mode), they are shown and cannot be disabled.
Indicator Shown (Play-mode)
Somehow, when indicator labels shown/or hidden - enabling/or disabling Indicator labels (Play-mode) on axises does not change their active state. Is it intended?
By the way, i downloaded Demo project, and seen there same behavior in candlestick charts. If you enable/disable tooltip component (Play-mode), indicator labels are shown and cannot be disabled.
@monitor1394
The text was updated successfully, but these errors were encountered: