- Home
- Forum
- Xamarin.Android
- ColumnSeries Chart disappear after showing the tooltip with the column value
ColumnSeries Chart disappear after showing the tooltip with the column value
Hi,
Attachment: Archive_33fda386.zip
I don't know why but setting the ToolTip enable for my column data is causing the entire chart to disappear. Here's my code to load the Chart Columns:
In my Fragment:
var chartService = Mvx.Resolve<IChartService> ();
frame_basket = view.FindViewById<FrameLayout> (Resource.Id.frame_basket);
frame_basket.AddView(chartService.GetBasketSizeColumnChart(this.Activity, IndicatorsVm.BarsData.ElementAt(0)));
frame_basket = view.FindViewById<FrameLayout> (Resource.Id.frame_basket);
frame_basket.AddView(chartService.GetBasketSizeColumnChart(this.Activity, IndicatorsVm.BarsData.ElementAt(0)));
The GetBasketSizeColumnChart function is defined:
#region GetBasketSizeColumnChart
public View GetBasketSizeColumnChart (Context context, CurrentMonthIndicator indicator)
{
SfChart chart = new SfChart(context);
chart.SetBackgroundColor(Color.White);
chart.Legend.Visibility = Visibility.Visible;
chart.Legend.ToggleSeriesVisibility = true;
chart.Legend.DockPosition = ChartDock.Bottom;
CategoryAxis categoryaxis = new CategoryAxis();
categoryaxis.LabelPlacement = LabelPlacement.BetweenTicks;
categoryaxis.Title.Text = indicator.Name;
chart.PrimaryAxis = categoryaxis;
// Calculate the numerical axis
var max = System.Math.Max(indicator.RealValue, indicator.TargetValue);
NumericalAxis numericalaxis = this.GetNumericalAxis (max);
chart.SecondaryAxis = numericalaxis;
// Real data
ColumnSeries columnSeries1 = new ColumnSeries();
columnSeries1.Label = context.Resources.GetString(Resource.String.sales_indicators_real);
columnSeries1.LegendIcon = ChartLegendIcon.Rectangle;
var dataReal = new ObservableArrayList();
dataReal.Add(new ChartDataPoint(context.Resources.GetString(Resource.String.sales_indicators_real), (double)indicator.RealValue));
columnSeries1.DataSource = dataReal;
// Target Data
ColumnSeries columnSeries2 = new ColumnSeries();
columnSeries2.Label = context.Resources.GetString(Resource.String.sales_indicators_target);
columnSeries2.LegendIcon = ChartLegendIcon.Rectangle;
var dataTarget = new ObservableArrayList();
dataTarget.Add(new ChartDataPoint(context.Resources.GetString(Resource.String.sales_indicators_target), (double)indicator.TargetValue));
columnSeries2.DataSource = dataTarget;
chart.Series.Add(columnSeries1);
chart.Series.Add(columnSeries2);
columnSeries1.TooltipEnabled = true;
columnSeries2.TooltipEnabled = true;
return chart;
}
#endregion
public View GetBasketSizeColumnChart (Context context, CurrentMonthIndicator indicator)
{
SfChart chart = new SfChart(context);
chart.SetBackgroundColor(Color.White);
chart.Legend.Visibility = Visibility.Visible;
chart.Legend.ToggleSeriesVisibility = true;
chart.Legend.DockPosition = ChartDock.Bottom;
CategoryAxis categoryaxis = new CategoryAxis();
categoryaxis.LabelPlacement = LabelPlacement.BetweenTicks;
categoryaxis.Title.Text = indicator.Name;
chart.PrimaryAxis = categoryaxis;
// Calculate the numerical axis
var max = System.Math.Max(indicator.RealValue, indicator.TargetValue);
NumericalAxis numericalaxis = this.GetNumericalAxis (max);
chart.SecondaryAxis = numericalaxis;
// Real data
ColumnSeries columnSeries1 = new ColumnSeries();
columnSeries1.Label = context.Resources.GetString(Resource.String.sales_indicators_real);
columnSeries1.LegendIcon = ChartLegendIcon.Rectangle;
var dataReal = new ObservableArrayList();
dataReal.Add(new ChartDataPoint(context.Resources.GetString(Resource.String.sales_indicators_real), (double)indicator.RealValue));
columnSeries1.DataSource = dataReal;
// Target Data
ColumnSeries columnSeries2 = new ColumnSeries();
columnSeries2.Label = context.Resources.GetString(Resource.String.sales_indicators_target);
columnSeries2.LegendIcon = ChartLegendIcon.Rectangle;
var dataTarget = new ObservableArrayList();
dataTarget.Add(new ChartDataPoint(context.Resources.GetString(Resource.String.sales_indicators_target), (double)indicator.TargetValue));
columnSeries2.DataSource = dataTarget;
chart.Series.Add(columnSeries1);
chart.Series.Add(columnSeries2);
columnSeries1.TooltipEnabled = true;
columnSeries2.TooltipEnabled = true;
return chart;
}
#endregion
Once the animation of the tooltip finished the chart is reloaded somehow with no data.
Am I doing something wrong?
I have attached couple of images with the results.
Attachment: Archive_33fda386.zip
SIGN IN To post a reply.
3 Replies
MS
Mohamed Samsudeen K S
Syncfusion Team
February 25, 2016 10:05 AM UTC
Hi Ramón,
We are unable to reproduce the issue with the provided details. We have created a sample and attached for your reference.
SimpleSample
If the issue still persists, then please provide us the modified sample to validate the issue.
Regards,
Samsudeen K S
We are unable to reproduce the issue with the provided details. We have created a sample and attached for your reference.
SimpleSample
If the issue still persists, then please provide us the modified sample to validate the issue.
Regards,
Samsudeen K S
MS
Mohamed Samsudeen K S
Syncfusion Team
February 25, 2016 10:05 AM UTC
Hi Ramón,
We are unable to reproduce the issue with the provided details. We have created a sample and attached for your reference.
SimpleSample
If the issue still persists, then please provide us the modified sample to validate the issue.
Regards,
Samsudeen K S
We are unable to reproduce the issue with the provided details. We have created a sample and attached for your reference.
SimpleSample
If the issue still persists, then please provide us the modified sample to validate the issue.
Regards,
Samsudeen K S
MS
Mohamed Samsudeen K S
Syncfusion Team
February 25, 2016 10:05 AM UTC
Hi Ramón,
We are unable to reproduce the issue with the provided details. We have created a sample and attached for your reference.
SimpleSample
If the issue still persists, then please provide us the modified sample to validate the issue.
Regards,
Samsudeen K S
We are unable to reproduce the issue with the provided details. We have created a sample and attached for your reference.
SimpleSample
If the issue still persists, then please provide us the modified sample to validate the issue.
Regards,
Samsudeen K S
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
RE Ramón Esteban
- Feb 24, 2016 05:30 PM UTC
- Feb 25, 2016 10:05 AM UTC