Setting layer ID in exported SVG


Author
Message
rich dudley
rich dudley
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
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
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.1K
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
rich dudley
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
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
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.1K
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


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic
1 active, 1 guest, 0 members, 0 anonymous
No members currently viewing this topic!

Login

Explore
Messages
Mentions
Search