Profile Picture

Setting layer ID in exported SVG

Posted By rich dudley 7 Years Ago
Author
Message
rich dudley
Posted 7 Years Ago
View Quick Profile
Forum Guru

Forum Guru (51 reputation)Forum Guru (51 reputation)Forum Guru (51 reputation)Forum Guru (51 reputation)Forum Guru (51 reputation)Forum Guru (51 reputation)Forum Guru (51 reputation)Forum Guru (51 reputation)Forum Guru (51 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 33, Visits: 76
Elements in SVG images can have ID set for them which can be programmatically searchable in image editing software, does Nevron make this an accessible option?


Tags
svg
Nevron Support
Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:38 AM
Posts: 3,054, Visits: 4,006
Hi Rich,
By default the control will export the element/atom pair as id attribute in SVG. You can however inject any attribute name/value pair inside the generated SVG using the interactivity style - for example:

   NChart chart = nChartControl1.Charts[0];

   NBarSeries bar = new NBarSeries();

   NInteractivityStyle interactivityStyle = new NInteractivityStyle();
   interactivityStyle.CustomMapAreaAttribute.JScriptAttribute = "AttributeName='bar'";
   bar.Values.Add(10);
   bar.InteractivityStyles.Add(0, interactivityStyle);
   bar.Values.Add(20);
   bar.Values.Add(30);

   chart.Series.Add(bar);

   NSvgImageFormat svgImageFormat = new NSvgImageFormat();
   svgImageFormat.EnableInteractivity = true;
   nChartControl1.ImageExporter.SaveToFile("c:\\temp\\test.svg", svgImageFormat);

In the above example all svg export that is associated with the first bar will have a custom attribute. Hope this helps - let us know if you meet any problems or have any questions.


Best Regards,
Nevron Support Team



rich dudley
Posted 7 Years Ago
View Quick Profile
Forum Guru

Forum Guru (51 reputation)Forum Guru (51 reputation)Forum Guru (51 reputation)Forum Guru (51 reputation)Forum Guru (51 reputation)Forum Guru (51 reputation)Forum Guru (51 reputation)Forum Guru (51 reputation)Forum Guru (51 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 33, Visits: 76
Unfortunately enabling interactivity severally impacts the aesthetic of the graph. Its not usable with the line broken up like this.
Example:
https://www.nevron.com/forum/uploads/images/1e5196a1-d549-4f01-88fa-b7ac.png


Nevron Support
Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:38 AM
Posts: 3,054, Visits: 4,006
Hi Rich,
Try using the following code:
lineSeries.SamplingMode = SeriesSamplingMode.Enabled;
In this mode the line series will not export interactivity information per data point and the line joins should work.
Let us know if you meet any problems.


Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic