Tooltip text color on a point of a chart

Oystein Bjorke 10 ár síðan 0
This discussion was imported from CodePlex

gustavosramos wrote at 2013-11-06 16:51:

I'm having some difficulties to change the default color of a tooltip text of my chart. I actually dont know why my chart is rendering a white text color on my tooltip.

Image

Here is my code that mounts the plot:
public void LoadData(long CheckPointID)
{
    //[...]
    var lineTempSerie = new LineSeries
                        {
                            StrokeThickness = 2,
                            MarkerSize = 3,
                            MarkerType = MarkerType.Circle,
                            CanTrackerInterpolatePoints = false,
                            Title = "Temperatura",
                            MarkerStrokeThickness = 3,
                            Smooth = false,
                        };
    //[...]
    PlotModel m = ListTempPlotModel.Find(x => x.Title == "Canal " + chn);
    //[...]
    if (m != null)
    {
        if (m.Series.Count == 0)
        {
            m.Series.Add(lineTempSerie);
            m.TextColor = OxyColors.Black;
            m.SubtitleColor = OxyColors.Black;

            //List<OxyColor> colors = new List<OxyColor>(); 
            //colors.Add(OxyColors.Black);
            //m.DefaultColors = colors as IList<OxyColor>;
            break;
        }
    }            
    //tempPlotModel.Series.Add(lineTempSerie);
    //ListTempPlotModel.Add(tempPlotModel);
    }
}

public void SetUpModel(long CheckPointID)
{
    //[...]
    OxyPlot.Annotations.LineAnnotation annoTempMin = new OxyPlot.Annotations.LineAnnotation();
    OxyPlot.Annotations.LineAnnotation annoTempMax = new OxyPlot.Annotations.LineAnnotation();
    //[...]
    OxyPlot.Annotations.LineAnnotation annoHumMin = new OxyPlot.Annotations.LineAnnotation();
    OxyPlot.Annotations.LineAnnotation annoHumMax = new OxyPlot.Annotations.LineAnnotation();
    //[...]
    PlotModel tempPlotModel = new PlotModel();
    tempPlotModel.LegendTitle = "Legenda";
    tempPlotModel.LegendOrientation = LegendOrientation.Horizontal;
    tempPlotModel.LegendPlacement = LegendPlacement.Outside;
    tempPlotModel.LegendPosition = LegendPosition.TopRight;
    tempPlotModel.LegendBackground = OxyColor.FromAColor(200, OxyColors.White);
    tempPlotModel.LegendBorder = OxyColors.Black;
    tempPlotModel.LegendTextColor = OxyColors.Black;
    //[...]
}
Is there anyone to help ?

tks

everytimer wrote at 2013-11-07 09:19:

You may need to set the Foreground of your Plot in XAML:
  <oxy:Plot x:Name="plotter" Model="{Binding MyModel}"
                                 
                                  Foreground="Black">
Good luck