Jump to content
Software FX Community

Arys

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by Arys

  1. The FOR loop only changes the keylabels the first time, thus apearing in the chart like 0,1,2,3,4,5... and so but the second time onwards the keylabels get modified if i perform a watch on them but they are not updated in the chart and not updated in the legendbox. I also tried to perform a axesx.clear() at the beggining but nothing. And sometimes when i put a breakpoint in the code to add watches to the keylabels, they get added correctly, then remove the break point and there is the problem again. Is there any method i should call to finalize the data edition?
  2. this.mFarmLoadChart.LegendBox.ItemAttributes.Clear(); this.mFarmLoadChart.LegendBox.ItemAttributes[this.mFarmLoadChart.Series].visible = false; this.mFarmLoadChart.LegendBox.ItemAttributes[this.mFarmLoadChart.AxisX].visible = true; for (int i = 1; i < this.mFarmLoadChart.AxisX.Labels.Count + 1; i++) { this.mFarmLoadChart.AxisX.KeyLabels[i - 1] = this.mFarmLoadChart.AxisX.Labels[i - 1]; this.mFarmLoadChart.AxisX.Labels[i - 1] = i.ToString(); } this.mFarmLoadChart.LegendBox.Visible = true; I perform this code each time after the data has been binded to the chart. The first time it loads the legend box is correct, next tryes legendbox appears empty. I have checked the properties and Keylabels contains strings, and are > 0, and the visible propertie for that axis is true. Anyone knows what could be the problem?
  3. Basically i had to fill the chart.AxisX.KeyLabel for each element since the legend box uses it to show the names. One this property was filled the legend box was showing the data correctly.
  4. mFarmLoadChart.DataSourceSettings.Fields.Clear(); mFarmLoadChart.Series.Clear(); mFarmLoadChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns[0].ColumnName, FieldUsage.NotUsed)); mFarmLoadChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns[1].ColumnName, FieldUsage.Label)); mFarmLoadChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns[2].ColumnName, FieldUsage.NotUsed)); mFarmLoadChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns[3].ColumnName, FieldUsage.NotUsed)); mFarmLoadChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns[4].ColumnName, FieldUsage.NotUsed)); mFarmLoadChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns[5].ColumnName, FieldUsage.NotUsed)); if (data.Table.Columns.Count > Keys.Analyzer.ColumnarFarmLoad.ColumnsToSkipBeforeSeries) { for (int i = Keys.Analyzer.ColumnarFarmLoad.ColumnsToSkipBeforeSeries; i < data.Table.Columns.Count; i++) { mFarmLoadChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns.ColumnName, FieldUsage.Value)); mFarmLoadChart.DataSourceSettings.Fields.DisplayName = data.Table.Columns.Caption; } mFarmLoadChart.Gallery = Gallery.Bar; mFarmLoadChart.LegendBox.Visible = false; mFarmLoadChart.AxisX.Step = 3; mFarmLoadChart.AxisX.Staggered = true; mFarmLoadChart.DataSourceSettings.DataSource = data; for (int i = Keys.Analyzer.ColumnarFarmLoad.ColumnsToSkipBeforeSeries; i < data.Table.Columns.Count; i++) { int iCounter = i - Keys.Analyzer.ColumnarFarmLoad.ColumnsToSkipBeforeSeries; ChartFX.WinForms.SeriesAttributes serie = mFarmLoadChart.Series[iCounter]; // === Set Fram Load Id === serie.Tag = data.Table.Columns.ExtendedProperties[Keys.Analyzer.ColumnarFarmLoad.ExtPropFarmLoadId]; // === Set Color === if (RtgAnalyzerConfigurationManager.Current.Configuration.UseAlgorithmColors || RtgAnalyzerConfigurationManager.Current.Configuration.MonochromaticMode) { serie.Color = (Color)data.Table.Columns.ExtendedProperties[Keys.Analyzer.ColumnarFarmLoad.ExtPropColorKey]; } // === Set Series Legend === serie.Text = data.Table.Columns.Caption; serie.AxisY = mFarmLoadChart.AxisY; } } Basically it adds the first 6 columns (only 1 usable to get the name) and then create the rest of the columns depending on the number of items. This code basically binds the dataview and loads the chart but i am not able to set the legendbox to show the AxisX labels.
  5. By default the legendbox takes the axisY as the main one to show the items. I would like to set it to take the AxisX Keylabels instead, and in the help document says it can show Series (AxisY), Keylabels(AxisX), Gridlines and CustomItems. How do you set it to load the Keylabels? There is an example of creating custom items but is not so useful.
  6. Once you add those references to your project you can browse them in the Object Browser by right clicking on them. For example for the Wrapper dll I can see the Namespaces inside are like "namespace SoftwareFX.ChartFX.Wrapper", so if you type the using clausule with SoftwareFX.ChartFX.Wrapper you will be able to see in the intelisense menu all the components. For the Wrapper.Exporting the namespace is "namespace ChartFX.WinForms.Wrapper.Exporting", so if you type that namespace in the using clausule you will be able to see the components in intelisense. Perform a simple test, if you only have added the references, in your code type "SoftwareFX.ChartFX.Wrapper." that way you will see if its okay or not. If its okay just add the using clausule and there you go.
  7. Found the solution. At the moment of the field creation i modify the DisplayName of it and works great. for (int i = Analyzer.ColumnarFarmLoad.ColumnsToSkipBeforeSeries; i < data.Table.Columns.Count; { MyChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns.ColumnName, FieldUsage.Value)); MyChart.DataSourceSettings.Fields.DisplayName = data.Table.Columns.Caption; }
  8. Basically i create the fields and bind the datasource, all perfect, but then i want to loop thru the series to change their name and put the columns.caption. The first time the chart loads the names appear perfectly, but the rest of times the chart loads another datasource and/or goes back to the original datasource, i shows the name of the columns as the serie.text property. Do you know what should i do? I leave u here the code for better understanding //Create Fields MyChart.DataSourceSettings.Fields.Clear(); MyChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns[0].ColumnName, FieldUsage.NotUsed)); MyChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns[1].ColumnName, FieldUsage.Label)); MyChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns[2].ColumnName, FieldUsage.NotUsed)); MyChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns[3].ColumnName, FieldUsage.NotUsed)); MyChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns[4].ColumnName, FieldUsage.NotUsed)); MyChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns[5].ColumnName, FieldUsage.NotUsed)); //Every column from now on is Value //Analyzer.Columnar.ColumnsToSkipBeforeSeries = 6 (for u to know), that way i skip the first 6 columns that are not used, only 1 field for display AxisX names. for (int i = Analyzer.Columnar.ColumnsToSkipBeforeSeries; i < data.Table.Columns.Count; i++) { MyChart.DataSourceSettings.Fields.Add(new FieldMap(data.Table.Columns.ColumnName, FieldUsage.Value)); } //General Info and DataBinding MyChart.Gallery = Gallery.Bar; MyChart.LegendBox.Visible = false; MyChart.AxisX.Step = 3; MyChart.AxisX.Staggered = true; MyChart.DataSourceSettings.DataSource = data; //Change of the text property for (int i = 0; i < data.Table.Columns.Count; i++) { int iCounter = i + Analyzer.Columnar.ColumnsToSkipBeforeSeries; ChartFX.WinForms.SeriesAttributes serie = MyChart.Series; // === Set Series Legend === serie.Text = data.Table.Columns[iCounter].Caption; } }
  9. GREAT!!!!! With the first comment i made the chart to load all the data perfectly, but i had some problems with the types, then its when the types came in. Thanks a lot guys, the chart is looking amazing right now.
  10. ChartFX.WinForms.Adornments.GradientBackground gradientBackground1 = new ChartFX.WinForms.Adornments.GradientBackground(); this.MyChart.Background = gradientBackground1;
  11. Hello all, this is a very newbie question but with the help document i cannot bind a datatable to the chart. Basicallyi am not getting the datatable from a database, im creating a datablewith dynamic data that the user types in the application. The thing is when i bind the datable to the chart, doesnt display the value. DataTable t = new DataTable();t.Columns.Add("Name");t.Columns.Add("Age");DataRow dr = t.NewRow();dr[0] = "Duncan";dr[1] = 25;t.Rows.Add(dr);mFarmLoadChart.DataSource = t; Doi need to set some basic stuff to the chart like series and such? Sorryto bother you with such a trivial thing but reading the documentation icouldnt find out what are the most basic settings i must set for thechart to load a datatable.
×
×
  • Create New...