Jump to content
Software FX Community

AndreG

Staff
  • Posts

    333
  • Joined

  • Last visited

Posts posted by AndreG

  1. This works for me. Can you post your results (C#, sorry, not so good with VB)?

                    chart1.Data.Series = 3;

                    chart1.Data.Points = 10;

                    Random r = new Random();

                    for (int i = 0; i < chart1.Data.Series; i++) {

                        for (int j = 0; j < chart1.Data.Points; j++) {

                            chart1.Data[i, j] = r.Next(100);

                        }

                    }

                    chart1.Gallery = Gallery.Bar;

                    chart1.AllSeries.Stacked = Stacked.Stacked100;

                    chart1.AllSeries.PointLabels.Visible = true; 

  2. For the license to be included on the project you must compile the code that instantiates the chart as an executable. If this is not how you plan to use the chart, an alternative is to instantiate a dummy chart in the executable that loads the components where your real chart are created. Would this be an option for you?

  3. This behavior is by design. Not sure how you were expecting to see negative values on a pie chart. Since the value is used to calculate the size of the area in the pie, a negative value would yield negative area. That is why we just use the absolute value to calculate the area.

  4. The chart tooltip comes from the image map. chart1.AllSeries.Link.OnMouseOver changes the onmouseover event on the area of the image map. The tooltips changes the text property of the area of the image map (which most browsers use to display tooltip). So if you are going to use onmouseover, I would recommend that you turn off the chart tooltip.

    Note: if your image marker is not circular, this might not work for you. Test the different markers and see what type of area they use on the source of the page.

  5. Hello Bowofolaf,

     Unfortunately this is not possible with the chart tooltips API. But it might be accomplishable.  First, make the mouse over property of all points call your js code.

    chart1.AllSeries.Link.OnMouseOver =

    "mouseover(this);";

     

    Then, display your own tooltip using js:

    <script type="text/javascript">function mouseover(item) {

    if (item.shape == 'circle') {

    //diplay tooltip code here

    }

    }

    </script>
  6. Take a look at the BubbleCharts sample that ships with the product, it does something like that. At first it sets the field usage for the field that holds the text as Label. Then it reads all the labels and sets in an array of strings. Finally it uses chart1_GetPointLabel to read from the array of strings into the Text property of the point.

  7. Oh, you can set field mapping on the XML too. Try this:

    <?xml version="1.0" encoding="UTF-8"?>

    <CFX7>

     <PANES>

    <ITEM index="0">

     <AXES>

    <ITEM index="0">

     <LABELSFORMAT>

    <FORMAT>Date</FORMAT>

     </LABELSFORMAT>

     <POSITION>Far</POSITION>

     <TITLE>

    <TEXT></TEXT>

     </TITLE>

    </ITEM>

     </AXES>

    </ITEM>

     </PANES>

     <AXESX>

    <ITEM index="0">

     <GRIDS>

    <MAJOR>

     <VISIBLE>False</VISIBLE>

    </MAJOR>

     </GRIDS>

     <LABELS>

    <ITEM>

     P2

    </ITEM>

    <ITEM>

     P1

    </ITEM>

     </LABELS>

     <TITLE>

    <TEXT></TEXT>

     </TITLE>

    </ITEM>

     </AXESX>

     <ALLSERIES>

    <GALLERYARRAY type="ChartFX.WinForms.Internal.IGalleryType[]">

     <ITEM index="0" type="ChartFX.WinForms.Galleries.Line"/>

     <ITEM index="19" type="ChartFX.WinForms.Galleries.Bar"/>

    </GALLERYARRAY>

    <GALLERY>Gantt</GALLERY>

     </ALLSERIES>

     <SERIES>

    <ITEM index="0"/>

     </SERIES>

     <LEGENDBOX>

    <VISIBLE>False</VISIBLE>

     </LEGENDBOX>

     <DATAGRID>

    <VISIBLE>True</VISIBLE>

     </DATAGRID>

     <BORDER type="ChartFX.WinForms.Adornments.ImageBorder" assembly="ChartFX.WinForms.Adornments, Version=7.0.4770.21916, Culture=neutral, PublicKeyToken=a1878e2052c08dce"/>

     <BACKGROUND type="ChartFX.WinForms.Adornments.GradientBackground" assembly="ChartFX.WinForms.Adornments, Version=7.0.4770.21916, Culture=neutral, PublicKeyToken=a1878e2052c08dce">

    <COLORS type="ChartFX.WinForms.Adornments.GradientBackground+ColorCollection" assembly="ChartFX.WinForms.Adornments, Version=7.0.4770.21916, Culture=neutral, PublicKeyToken=a1878e2052c08dce"/>

     </BACKGROUND>

     <DATASOURCESETTINGS>

    <FIELDS>

     <ITEM>

    <NAME>Project</NAME>

    <USAGE>Label</USAGE>

     </ITEM>

     <ITEM>

    <NAME>Start</NAME>

    <USAGE>FromValue</USAGE>

     </ITEM>

     <ITEM>

    <NAME>Finish</NAME>

    <USAGE>Value</USAGE>

     </ITEM>

    </FIELDS>

     </DATASOURCESETTINGS>

    </CFX7>

  8. Chart1.Data.Clear() is not clearing the labels in the X axis (since that is not necessarily data). I would just reset the chart before passing new data to it Chart1.Reset(). Note that if you do that you will need to reconfigure all the properties you set in markup, including the size of the chart. Maybe export all properties and then import them back after a reset?

  9. You need to set up your field mapping before passing the data to the chart. This worked for me:

    chart1.Import(FileFormat.Xml, "C:\\temp\\chart.cfx");

     

    chart1.DataSourceSettings.Fields.Add(
    new FieldMap("Project", FieldUsage.Label));

    chart1.DataSourceSettings.Fields.Add(

    new FieldMap("Start", FieldUsage.FromValue));chart1.DataSourceSettings.Fields.Add(new FieldMap("Finish", FieldUsage.Value));

    XmlDataProvider cfxXML = new XmlDataProvider();string dataPath = "C:\\temp\\data.xml";

    cfxXML.Load(dataPath);

    chart1.DataSourceSettings.DataSource = cfxXML;

×
×
  • Create New...