Jump to content
Software FX Community

maximop

Members
  • Posts

    229
  • Joined

  • Last visited

Posts posted by maximop

  1. The ChangedByUser event is fired before a change is performed on the chart; however, we only fire this event once since any subsequent changes are considered a waste as the chart is already dirty.

    Furthermore, you can implement the InternalCommand event which fires every time a chart command is processed; wether is from the MenuBar, ToolBar, or ContextMenu, this event is always fired. Unfortunately, you cannot tell exactly what change was actually done but you could let the user know that a change was made on the chart.

    In regards to the DISPID of the events, a list was not provided in that article since when you right click on the chart, select Events, and add the desired event, this information is automatically provided in the code within the EVENTSINK_MAP portion; however, for your convenience, I am putting here a list of the most commonly used events with their respective DISPIDs:

    Event DISPID

    AttributesChanged  21

    ChangedByUser 16

    DataChangedByUser  18

    Highlighted   20

    InternalCommand 14

    MouseDown   10

    MouseMove 12

    MouseUp   11

    UserCommand 15

    PostPaint   3

  2. In order to change the Font of the LegendBox, you have to pass a new instance of the Font class as follows:

    chart1.LegendBox.Font =

    new Font("Arial", 8);

    I have found that the size of the font will also increase/decrease the size of the marker inside the LegendBox.

    The bottom line is that there is no fix solution for minimizing the size of the LegendBox; its size actually depends on how many LegendBoxItems you are showing when plotting the chart.

  3. The ChartFX.Silverlight.Client.dll and ChartFX.WebForms.Writer.Silverlight.dll provided in the sample are compiled against the 2.0 runtime of Silverlight 2.0 Beta 1.

    The version that was previously provided in ChartFX 7 was compiled against the Silverlight 1.1 version. The new version is not officially out as we are finishing tests so we can release this with our new installers; however, I am attaching these two new .dlls for you to try. Make sure you place them in the bin folder of your ChartFX extension.

    Furthermore, the sample I provided you was built using the Silverlight 2.0 Beta 1 SDK and Visual Studio 2008. My machine, where I created this sample, has a clean installation of the 2.0 runtime and SDK of Silverlight.

    In regards to your issue, what exactly is the problem you are experiencing? Can you post a screenshot for further reference?

  4. Unfortunately, the standard legend box in ChartFX for .NET 6.2 does not provide a way to order the legend box items; however, you could hide the standard legend box and create your own UserLegendBox adding each UserLegendBoxItem in the order in which you need them to show. You could do something like the following:

    chart1.UserLegendBox = true;

    UserLegendBoxItem userLegendBoxItem = chart1.UserLegendBoxObj.Item[0];userLegendBoxItem.Label = "Below 100MB";

    userLegendBoxItem.Color = System.Drawing.

    Color.Red;userLegendBoxItem.MarkerShape = SoftwareFX.ChartFX.MarkerShape.Rect;

    userLegendBoxItem.BorderEffect = SoftwareFX.ChartFX.

    BorderEffect.None;userLegendBoxItem.BorderColor = System.Drawing.Color.Black;

    userLegendBoxItem = chart1.UserLegendBoxObj.Item[1];

    userLegendBoxItem.Label = "Below 500MB";

    userLegendBoxItem.Color = System.Drawing.

    Color.Yellow;userLegendBoxItem.MarkerShape = SoftwareFX.ChartFX.MarkerShape.Rect;

    userLegendBoxItem.BorderEffect = SoftwareFX.ChartFX.

    BorderEffect.None;userLegendBoxItem.BorderColor = System.Drawing.Color.Black;

    userLegendBoxItem = chart1.UserLegendBoxObj.Item[2];

    userLegendBoxItem.Label =

    "Below 1GB"; userLegendBoxItem.Color = System.Drawing.Color.Green;

    userLegendBoxItem.MarkerShape = SoftwareFX.ChartFX.

    MarkerShape.Rect; userLegendBoxItem.BorderEffect = SoftwareFX.ChartFX.BorderEffect.None;

    userLegendBoxItem.BorderColor = System.Drawing.

    Color.Black;

    Please note that the functionality you are looking for is available in ChartFX 7 via the LegendItemAttributes Collection.

    Charts.zip

  5. As I mentioned before, you can set the Text property of each individual pie slice and then use the %L variable setting of the PointLabels.Format property to show those values; in addition, you can use the %p variable setting to show the percentage that this pie slice represents. You can do as follows:

    chart1.AllSeries.PointLabels.Visible = true;

    chart1.Points[0, 0].Text =

    "Slice 1";chart1.Points[0, 1].Text = "Slice 2";

    chart1.Points[0, 2].Text =

    "Slice 3";chart1.Points[0, 0].PointLabels.Format = "%L" + " is %p%%"; chart1.Points[0, 1].PointLabels.Format = "%L" + " is %p%%";

    chart1.Points[0, 2].PointLabels.Format =

    "%L" + " is %p%%";

    For more information about these variable settings, please refer to the Format property of the PointLabelAttributes class in the Samples & Resource Center (Documentation installed with the product).

    X-Axis labels.zip

  6. Unfortunately, there is no way to optimize the look for the gauge labels; however, as a workaround, you could export the gauge to a memory stream, and draw the image directly to the Print Object in the PrintPage() Event using GDI+. You could provide a button in your application for PrintPreview, for example, which will fire this PrintPage() event thus showing the gauge image with much better quality. Below, please find a code snippet on how to implement this solution:

    public partial class _Default : System.Web.UI.Page

    {

    private MemoryStream ms;protected void Page_Load(object sender, EventArgs e)

    {

    ms = new MemoryStream();

    RadialGauge1.MainValue = 75;

    RadialGauge1.MainScale.Min = 0;

    RadialGauge1.MainScale.MinAlwaysDisplayed = true;

    RadialGauge1.MainScale.Max = 100;

    RadialGauge1.MainScale.MaxAlwaysDisplayed =

    true;RadialGauge1.Export(ImageFormat.Jpeg, ms);

    ms.Position = 0;

    PrintDocument pd = new PrintDocument();

    pd.PrintPage +=

    new PrintPageEventHandler(pd_PrintPage);System.Windows.Forms.PrintPreviewDialog ppd = new System.Windows.Forms.PrintPreviewDialog();

    ppd.Document = pd;

    ppd.ShowDialog();

    }

    void pd_PrintPage(object sender, PrintPageEventArgs e)

    {

    e.Graphics.DrawImage(System.Drawing.Image.FromStream(ms), new Point(25, 25));

    }

    }

  7. You can use the ScrollPosition property of the DataGrid; this property scrolls the data horizontally to the specific column in the grid. You can do as follows:

    chart1.DataGrid.Visible = true;

    chart1.DataGrid.ScrollPosition = 20;

    The above value will scroll the DataGrid to the 20th column.

  8. In order to show a label inside a pie slice, you need to enable the point labels for that slice and set the point labels format with one of the pre-defined variable settings; please refer to the ChartFX documentation for more information about this property.

    chart1.Points[0, 0].PointLabels.Format = "%L";

    chart1.Points[0, 0].PointLabels.Visible =

    true;

    In addition, you can set the Text property of the particular point you want to show the point label for, and the %L of the point labels format will show this value.

    chart1.Points[0, 0].Text =

    "Slice 1";
  9. I just noted that it was in the wrong forum since you reported this under ChartFX for .NET 6.2 and not under ChartFX ClientServer 6.2.

    In addition, if you are developing a Visual Basic 6 application using our ClientServer component, please refer to the Samples and Resource Center (Documentation installed with the product) which shows numerous samples related to your programming environment.

×
×
  • Create New...