Jump to content
Software FX Community

Import doesn't take Section Colors


Jshafer55343
 Share

Recommended Posts

I am using Import and Export to pass formats between to gauges using the XML FileFormat, but they appears to be just minimum and maximum values in the XML and the colors seem to be the default for the Palette selected. 

How do I get the colors to transfer between gauges? 

Thanks,

Jacob

************

I have attached the code and an example of the XML where the colors were selected but they do not appear.

 Example XML:

<?xml version="1.0" encoding="UTF-8"?>

<RadialGauge>

<BACKCOLOR>Transparent</BACKCOLOR>

<BORDER>

  <STYLE>RectangularBorder02</STYLE>

</BORDER>

<PALETTE>Default</PALETTE>

<TITLES>

  <ITEM>

<VISIBLE>False</VISIBLE>

<LAYOUT>

<TARGET>AnchorPoint</TARGET>

</LAYOUT>

<TEXT>%v</TEXT>

  </ITEM>

</TITLES>

<SCALES>

  <ITEM>

<COLOR>#ffd7e1f3</COLOR>

<INDEX>0</INDEX>

<MIN>0</MIN>

<MAX>100</MAX>

<TICKMARKS>

<VISIBLE>True</VISIBLE>

<MAJOR>

  <LABEL>

<VISIBLE>True</VISIBLE>

  </LABEL>

</MAJOR>

</TICKMARKS>

<BAR>

<BORDER>

  <VISIBLE>True</VISIBLE>

</BORDER>

</BAR>

<INDICATORS>

<ITEM type="ChartFX.WinForms.Gauge.Needle">

  <INDEX>0</INDEX>

</ITEM>

</INDICATORS>

<SECTIONS>

<ITEM>

  <INDEX>0</INDEX>

  <MAX>25</MAX>

</ITEM>

<ITEM>

  <INDEX>1</INDEX>

  <MIN>25</MIN>

  <MAX>75</MAX>

</ITEM>

<ITEM>

  <INDEX>2</INDEX>

  <MIN>75</MIN>

</ITEM>

</SECTIONS>

  </ITEM>

</SCALES>

</RadialGauge>

 Code:

Public Function PropertyToString(ByRef fromClass As ChartFX.WinForms.Gauge.BaseGauge) As String

  Dim memStream As New MemoryStream()

  Dim reader As StreamReader

  Dim propertyString As String

 

  fromClass.Export(ChartFX.WinForms.Gauge.FileFormat.XmlTemplate, memStream)

  memStream.Seek(0, SeekOrigin.Begin)

 

  reader = New StreamReader(memStream)

  propertyString = reader.ReadToEnd()

  reader.Close()

  memStream.Close()

 

  Return propertyString

  End Function

 

  Public Sub StringToClass(ByRef fromString As String, ByRef toClass As ChartFX.WinForms.Gauge.BaseGauge)

  Dim memStream As New MemoryStream()

  Dim writer As StreamWriter

 

  writer = New StreamWriter(memStream)

  writer.AutoFlush = True

  writer.Write(fromString)

  memStream.Seek(0, SeekOrigin.Begin)

 

  toClass.Import(ChartFX.WinForms.Gauge.FileFormat.XmlTemplate, memStream)

  writer.Close()

  memStream.Close()

  End Sub

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...