Jump to content
Software FX Community

W.D

Members
  • Posts

    29
  • Joined

  • Last visited

W.D's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, I'm trying to create a pie chart with UserLengendBox. The values I passed to the chart are dollar values. I tried to sum all values to a total value and then divide each value by total value to calculate percentage. But I found these values are not exactly add up to 100.0%. There's rounding, so it always add up to 99.9% or 100.1%. I know I can make point lables mask as "%p" to let ChartFX to calculate the percentage values. How can i use ChartFX's this function to get percentage without showing the point lables? Thanks. W.D
  2. Hi, I'm developing windows based application to create and export a large number of charts to JPEG image stream and then write to database. I found after a few successful export, I will get the error message "Object reference not set to an instance of an object" when the code executed to the line of " SoftwareFX.ChartFX.Internet.Server.Chart thisChart=new SoftwareFX.ChartFX.Internet.Server.Chart();". My sample code is below. My application in windows based, but I used SoftwareFX.ChartFX.Intenet.Server.Chart because I want to use the Export method to export JPEG image. I create the chart in memory. But even though I called thisChart.Dispose() and thisChart==null. I still keep getting this error. Please help. ********************************************************** for (int i=0; i<100; i++) { using (SoftwareFX.ChartFX.Internet.Server.Chart thisChart=new SoftwareFX.ChartFX.Internet.Server.Chart()) { System.IO.MemoryStream ms=new System.IO.MemoryStream(); thisChart.Export(SoftwareFX.ChartFX.Internet.Server.FileFormat.Jpeg, ms); } } Regards, W.D
  3. Hi Frank, I mean to keep all the pie at a consistent size. I understand there must be blank space. Is there anyway to make sure the blank space in between the pie and the legendbox? What I get now is the blank space is on the right side of the legendbox. I tried "UserLegendBoxObj.Alignment" as "Far" but it doesn't work. Is there a way to specify the alignment within the LegendBox? Thanks. Regards, W.D.
  4. I actually found I could achieve this by setting the UserLegendBoxObj.Width to a fixed value to force the pie stay in the same size. But that means there're big space on the right side of the UserLegendBox. So is there a better way to achieve the same result? Thanks.
  5. Hi, I'm working on some pie charts. They have legendbox on the right hand side. I found that their pie's size changes depending on the longest text in the legendbox. I wish I could keep the pie's size all the same. I tried to use TopGap, BottomGap, LeftGap and RightGap. It helped to change the size of the pie but also the size of the legendbox. The only way I could think of now is to add white spaces to the end of the legend text to force the pie take smaller space. Is there any other way to do it? Thanks.
  6. Hi, I'm trying to insert a chart to a PDF file. What I'm doing now is export chart to a Image file, and then insert this image file to the PDF. It works but the quality is not good, i.e. the chart is not sharp and the text is not as clear as it appears on the webpage. I just wonder if there's way to export a chart directly to high quality PDF. I can then insert this PDF into the destination PDF. Regards, W.D
  7. Hi, For a Pie chart, if there're more than just a few data points, or if the lables contain both names and values rather than just values, ChartFX put some labels far away from the Pie rather than closely around the pie chart. I have to reduce the font size of the pointlables to be very small to keep all labels closely around the pie. I tried to wrap the lables by inserting System.Environment.Newline into the labels but doesn't work. Could you please help with this one? Thanks. Regards, W.D
  8. I think I find a fix for my problem. To make a chart showing horizontal bars, it's not nessesary to be a Gantt. I could use Bar chart, and also the code below: Chart1.TypeMask = Chart1.TypeMask | SoftwareFX.ChartFX.ChartType.Horz; In this code, the problem (Vertical Axis invisible when re-setting Horizontal Axis's Max) can be avoided.
  9. I post this problem a while ago. Nobody replied. So I digged a bit further myself, but still not sure what's the problem. Initially I thought Gantt's AxisX is the vertical one, AxisY is the horizontal one. But when I use the code below to assign differnt color to the axis X and Y. I found the AxisX still is the horizontal one. I tried to change the Axis's Max to give more room to the pointlables. I tried both //Chart1.AxisY.Max=Chart1.AxisY.Max*1.1; //Chart1.AxisX.Max=Chart1.AxisY.Max*1.1; Only the "Chart1.AxisY.Max=Chart1.AxisY.Max*1.1;" is working. This somehow proves AxisY is the Horizontal one. After I change the Max Value, I found the Vertical Axis line disappears. That's very strange. Could anyone please help with this? Thanks a lot, W.D *************************************************************************** Chart1.Gallery = SoftwareFX.ChartFX.Gallery.Gantt; Chart1.AxesStyle=SoftwareFX.ChartFX.AxesStyle.Math; Chart1.AxisX.Visible=true; Chart1.AxisX.Line.Color=Color.Red; Chart1.AxisX.Line.Width=10; Chart1.AxisX.Line.Style=System.Drawing.Drawing2D.DashStyle.Solid; Chart1.AxisY.Visible=true; Chart1.AxisY.Line.Color=Color.Blue; Chart1.AxisY.Line.Width=10; Chart1.AxisY.Line.Style=System.Drawing.Drawing2D.DashStyle.Solid; Chart1.OpenData(SoftwareFX.ChartFX.COD.Values,1,3); Chart1.Legend[0]="Test1"; Chart1.Value[0,0] = 15; Chart1.Legend[1]="Test2"; Chart1.Value[0,1] = 20; Chart1.Legend[2]="Test3"; Chart1.Value[0,2] = 10; Chart1.CloseData(SoftwareFX.ChartFX.COD.Values); Chart1.RecalcScale();
  10. Hi, Is there a way to directly use CMYK value to create color for Chart? Regards, W.D
  11. Hi, Is there a way to keep UserLegendBoxItem inside the Gantt chart's plot area, i.e., within the chart's 4 axis's rectangle area? Regards, W.D
  12. Hi, I'm working a Gantt chart. But i found the AxisX (Left line) is invisible. Even I try to set value for AxisX's Line.Color, Line.Style, Line.Width, it's actually set these values to AxisY (Bottom line). It's very strange. Could you please help? Chart1.AxesStyle=SoftwareFX.ChartFX.AxesStyle.Math; Chart1.Gallery = SoftwareFX.ChartFX.Gallery.Gantt; Chart1.AxisX.Line.Style=System.Drawing.Drawing2D.DashStyle.Solid; Chart1.AxisX.Line.Color=Color.Black; Chart1.AxisX.Line.Width=5; Chart1.PointLabels=true; Chart1.Scrollable= false; Chart1.OpenData(SoftwareFX.ChartFX.COD.Values,2,3); for(int i=0;i<3;i++) { Chart1.Legend=...; Chart1.Value[0,i] = ...; Chart1.Value[1,i] = ...; Chart1.Point[0,i].Color=Color.Black; Chart1.Point[1,i].Color=Color.Red; } Chart1.CloseData(SoftwareFX.ChartFX.COD.Values); Chart1.AxisY.LabelsFormat.Decimals=1; Chart1.RecalcScale();
  13. Hi, I'm try to draw a bar chart with pointlabels. For the point with the value of 0.00, I want to show "Not Avaiable" instead of 0.00 as the pointlable. But I couldn't find a way to do it. Could you please help? Thanks a lot. W.D
×
×
  • Create New...