Jump to content
Software FX Community

AndreG

Staff
  • Posts

    333
  • Joined

  • Last visited

Posts posted by AndreG

  1.  Unlike other charts, the pie chart does not display one legend item per series. Since each slice on a pie represents a point, it makes more sense to display one item per point. Try the following.

    chart1.LegendBox.ItemAttributes[chart1.AxisX].Visible = false;

  2.  Not sure what you mean. Bubble charts work the same as other charts, supporting negative as well as positive values.

    chart1.Gallery = Gallery.Bubble;chart1.Data.Series = 2;chart1.Data.Points = 4;chart1.Data.Y[0, 0] = 10;chart1.Data.Y[0, 1] = -10;chart1.Data.Y[0, 2] = -10;chart1.Data.Y[0, 3] = 10;chart1.Data.X[0, 0] = 10;chart1.Data.X[0, 1] = 10;chart1.Data.X[0, 2] = -10;chart1.Data.X[0, 3] = -10;chart1.Data.Y[1, 0] = 10;chart1.Data.Y[1, 1] = 10;chart1.Data.Y[1, 2] = 10;chart1.Data.Y[1, 3] = 10;chart1.AxisX.Max = 15;chart1.AxisX.Min = -15;chart1.AxisY.Max = 15;chart1.AxisY.Min = -15;

  3.  The code bellow will generate the attached chart. I hope it is what you are looking for.

      Dim nSeries As Integer   Dim nPoints As Integer   Dim i As Integer   Dim j As Integer     nSeries = 4   nPoints = 5   i = 0   Chart1.OpenData COD_Values, nSeries, nPoints   Do While (i < nSeries)     j = 0   Do While (j < nPoints)   Chart1.Value(i, j) = (Rnd()) * 100   j = j + 1   Loop   i = i + 1   Loop   Chart1.CloseData COD_Values     Chart1.Series(0).Stacked = True   Chart1.Series(1).Stacked = True   Chart1.Series(2).Stacked = False   Chart1.Series(3).Stacked = True     Chart1.AxisY.Max = 200

  4. You could change your axis to be categorical instead of numerica. But then every point will be plotted with the same distance between them. So unless your data comes on a fixed period anyways, i can see how that would not work.

    The other way would be to implement the dragging yourself. You can use the mouse events, then when the click happens in one point you could use the PointToPixel and PixelToPoint methods. That way, using the pixel information you get on the mouse move event you can calculate the point information to pass the marker. Let me know if it makes sense.

  5.  I might have found something that could help you. There is a property in the Axis class called MaxSizePercentage. It will limit the space taken by the axis as a percentage, but in a brute way. It will clip the begining of the string. To avoid that you could force the clipping of the end of the string using LabelTrimming.

    Chart1.AxisX.MaxSizePercentage = 30;Chart1.AxisX.LabelTrimming = System.Drawing.StringTrimming.EllipsisWord;

  6. Edit: A little better results, less code. Forgot about the LabelTrimming property...

    Chart1.AxisX.MaxSizePercentage = 30;
    Chart1.AxisX.LabelTrimming = System.Drawing.StringTrimming.EllipsisWord;

     I might have found something that could help you. There is a property in the Axis class called MaxSizePercentage. It will limit the space taken by the axis as a percentage, but in a brute way. It will clip the begining of the string. To avoid that you could force the clipping of the end of the string, using the GetAxisLabel event. Make sure you turn on Notify for the Axis.

    Chart1.AxisX.MaxSizePercentage = 30;
    Chart1.AxisX.Notify = true;
    Chart1.GetAxisLabel += new AxisLabelEventHandler(Chart1_GetAxisLabel);

     And...

    protected void Chart1_GetAxisLabel(object sender, AxisLabelEventArgs e)
    {
      if (e.Axis == Chart1.AxisX)
      {
      if (e.Text.Length > 13)
      {
      e.Text = e.Text.Substring(0, 10) + "...";
      }
      }
    }

    post-2902-1392240967221_thumb.png

  7.  Thank you for pointing this out to us. I have noticed the gaffe and worked on a better version of that specific part of the Resource Center. It will be available for the public on the next Service Pack release. In case you would like to manually update your Resource Center, please contact support [at] softwarefx.com and they will be able to send you just the necessary files.

    Once again thanks for the feedback. Should you run into any issues like that again, please be sure to let us know.

  8.  Not sure why you are using crosstab there. Or why you set 2 different FieldUsages to one field. Take a look at the Resource Center, it explains on which cases to use the crosstab. Try the following.

    // Code to generate Bar Chart   Chart1.RenderFormat = ".NET";   Chart1.Height = Unit.Percentage(99);   Chart1.Width = Unit.Percentage(100);   Chart1.Gallery = Gallery.Bar;   Chart1.View3D.Enabled = true;   Chart1.View3D.BoxThickness = 10;   Chart1.AxisX.LabelsFormat.Format = AxisFormat.Number;   Chart1.AxisX.Title.Text = "X";   Chart1.AxisY.Title.Text = "Y";   DataTableProvider data = new ChartFX.WebForms.DataProviders.DataTableProvider(dt);   Chart1.DataSourceSettings.Fields.Add(new FieldMap("X", FieldUsage.Label));   Chart1.DataSourceSettings.Fields.Add(new FieldMap("Y", FieldUsage.Value));   Chart1.DataSource = data;   //Chart1.RecalculateScale(); No need for this

  9.  I wouldn't think this is a Chart FX bug. Haven't looked at that sample in a while, but I believe there is more to setting the series to the secondary axis than the code you have posted. It seems you will have to re-write other parts of the sample as well.

  10.  There is a sample that comes with CFX called BubbleCharts. It uses the GetPointLabel event to set each pointlabel. Have you taken a look at that?

    C:\Program Files\Chart FX 7\Help and Samples\Sample Applications\Windows Forms\VS2008\BubbleCharts

×
×
  • Create New...