Hi,
I'm using the UltraChart component from NetAdvantage 2009.2 and have come across an issue with the dimensions used when rendering a chart to SVG format.
A portion of our application makes use of a custom reporting library, which requires that images are sent to it in SVG format. To satisfy this requirement, I have written a WCF service which serves as a wrapper to the UltraChart component. It accepts 'chart data' as input and produces an SVG (Stream) as output.
However if I specify that the chart must be of a specific size (let's say 800 x 600), the resulting SVG output contains the correct sizing in the header (ie; viewBox="0 0 800 600"), but the remainder of the file contains sizing based on the dimensions of 400 x 300 (ie; width="399" height="299"). This issue occurs no matter what dimensions I specify (ie; the output always uses 400x300).
The only workaround that I have found for this issue, is to force the UltraChart component to render to an 'Image' first, then perform the rendering to SVG.
To reproduce this issue;
1. Create a new Windows Application (I'm using C# ...)
2. Add references to "System.Web", "Infragistics35.WebUI.Shared.v9.2" and "Infragistics35.WebUI.UltraWebChart.v9.2"
3. Copy the following code into the 'form load' of Form1;
Infragistics.WebUI.UltraWebChart.UltraChart loChart = new Infragistics.WebUI.UltraWebChart.UltraChart(); loChart.ID = DateTime.Now.ToString(); loChart.Width = 800; loChart.Height = 600; loChart.BackColor = Color.Blue;
//FileStream loFileStreamImage = File.OpenWrite("d:/temp/output.png"); //loChart.SaveTo(loFileStreamImage, Infragistics.UltraChart.Shared.Styles.RenderingType.Image); //loFileStreamImage.Flush(); //loFileStreamImage.Close();
FileStream loFileStreamSVG = File.OpenWrite("d:/temp/output.svg"); loChart.SaveTo(loFileStreamSVG, Infragistics.UltraChart.Shared.Styles.RenderingType.Svg); loFileStreamSVG.Flush(); loFileStreamSVG.Close();
Run the code 'as is' first (assuming you have a d:/temp folder!) to see the incorrect dimensions in the resulting SVG.
Then uncomment the code which first produces an Image rendering and allow the SVG to be rendered also. The resulting SVG this time contains the correct dimensions.
Questions:
1. Is there something that I need to set or invoke with the UltraChart component to avoid this issue?
2. Is this a bug within the Infragistics code ... or is there something else on my system that requires attention?
I would prefer not having to render to an Image first, each and every time that I need to render to SVG!
Any assistance you can provide in this matter would be greatly appreciated!
Thanks,
Jason.
Thanks Michael,
in your sample, use ultraTab which i couldnt find in my infragistics control, mine : 2010 v3(winform)
so i directly add the new tab in tabControl collections :
ultraTabControl1.BeginUpdate();
ultraTabControl1.Tabs.Add(newTabName,newTabKey);
ultraTabControl1.Tabs.Item[newTabName].TabPage.Controls.Add(newChartName);
ultraTabControl1.EndUpdate();
//without this : when render to pdf, will be small, but if with this code, all good.
ultraTabControl1.Tabs.Item[newTabName].Selected = true;
limited source codes attached.
if needed, i will attach the demo vids.
Thanks
I haven't been able to reproduce this issue. Could you take a look at the sample application that I attached to this forum thread and see if you can revise it so that it more closely resembles the scenario you are describing? Then could you repost it so that I can have a better idea of what the issue is? In the sample I have pie charts tabs and code to export the charts to PDF files? I don't see any difference in the exported files whether or not I first click on the tab that displays the chart. Maybe you could put your own charts into the tabs and see if that makes a difference in the results.
/*********************resolved*/
After step 2 , I added :
step 3 : ultraTab1:Tabs:Item[tabName]:Selected = TRUE.
in result :
will always go to last tab (chart no 3) after creation,
but when save to PDF using infra.Document : All Charts (chart 1, 2,3) will have a proper size in PDF file.
/*******************************/
note:
I'm using ":" in step 3 sample code, because I'm using this infragistic in Progress OpenEdge
If you are in Visual Studio, please use normal syntax "."
Don't be Confused
Cheers
/****************************/
Hi there
I also get this issue in winform. what i do:
1. create chart in runtime, set datasource, do bind(), set size, do the dock.
2. add this chart into ultraTab control
(repeat step 1-2 for other chart, total : let say : 3 charts)
issue :
* without go to each tab to see the chart , do save to pdf using infragistic.Document :
Result : chart size so small
*if we go to each tab to see the chart and do the save to PDF using infra.Document :
Result : chart size looks perfect.
Did I miss some sort of code ? such as focus(), performAction(), or others to make the Chart properly displayed ?
Thanks.
I created case CAS-48985-H7KNS3 for you so that you will be automatically notified when this issue is resolved.
Please see My IG - My Support Activity to view the case for more details.
Valerie
We have noticed that this has not been fixed in either a service release nor in the 2010.1 or 2010.2 releases. I'm also unable to find the bug in the knowledge base using the number provided.
Are you able to provide any details about which release this will be fixed in?