-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Background color #8
Comments
Without the svg file/code i have no idea what the problem could be. Or is this for every svg the same? |
It is happening within every image. I will post the svg file in a little bit. Our development is on a standalone network and I need to cut a CD. The legend box has a white background, but the overall chart does not. |
You could simply add a big rect with |
Related to the background not being displayed properly I looked at the SVG string produced from our javascript code: and it produces: If I remove the fill-opacity="0" stroke="none" a box is drawn based on the fill color, but it is a small square in the upper left corner. |
Here is an example of the SVG string.
|
please put the svg into a pastebin or in a code tag... its not displayed like this. |
Here is a post I added to the Ext.NET thread @ http://forums.ext.net/showthread.php?25590. The following javascript line of code: var svg = Ext.htmlEncode(Ext.draw.engine.SvgExporter.generate(#{Chart1}.surface)); produces the following SVG text:
I need to understand how SvgExporter.generate creates the SVG text because within the SVG text is the following definition:
It seems that no matter what my charts StyleSpec is the fill is always #fff:
I also do not understand the other attributes fill-opacity="0" stroke="none". If I submit the SVG text to http://www.fileformat.info/convert/image/svg2raster.htm , it looks like it displays properly. But if I manually modify the rectangle definition and change the fill="#fff" to fill="yellow" the background stays white. If I further remove fill-opacity="0" stroke="none" then I do get a back ground of yellow. If I call the SVG.dll and put a breakpoint to manually change the SVG text so the rectangle definition looks like:
I get the following image with only the upper left quadrant filled with yellow. Any thoughts? |
the rect 100% issue seems to be a bug... make sure you have set the width and height of the svg document to the size you want it rendered. i'll have a look at it next week. a quick fix is to set the rect width and height to the size you want it. e.g. 400x400 or so... |
No hurry. I appreciate all the work you have done to keep this code moving forward. I am on vacation for the next 16 days and will hopefully have some time to sit and investigate also. I am looking into the Ext javascript code to determine why they build the rectangle the way they do. My issue is the way the SVG text is handled and drawn between the SvgRaster website and the SVG.dll when I manually change the rect definition to Again not an immediate issue ... |
Closing this thread. It turns out that I was not correctly assigning the background to the chart in Ext.NET. I was using StyleSpec="background: yellow;" instead of the property |
that's good news. thanks for coming back on this. |
Am I missing something. The background color of the chart is different.
Chart - Screen Capture
Chart - SVG conversion to PNG
Thanks for the great work on keeping this code up to date!!!
The text was updated successfully, but these errors were encountered: