Announcement

Collapse
No announcement yet.

Pie Chart color Map

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pie Chart color Map

    Hello Everyone,
    I have a question about the Pie Chart color map values. I was able to convert RGB values to RGBA Decimals to get the colors to change from a template. The issue is how can I get the colors for the different pie slices to be delivered at the same time after they are selected in the template. It works great if its one color but I need the different colors to go to the other slices when I change the Color ID and the color is selected.
    Attached Files

  • #2
    We did something similar but in the scene we made a loop to go through the colors from the template.
    Code:
    for j = 1 to 8
      dim tmpMaterial as Material = this.FindSubcontainer("Name of the container that have the materials e.g. Colour1 to Colous 8" & j).Material
      dim tmpColor as Color 0 cColor(tmpMaterial.Emission.Red, tmpMaterial.Emission.Green, tmpMaterial.Emision.Blue,1)
      cRoot.FindSubContainer("ContainerHoldingThePieChartPlugin").GetGeometryPluginInstance().SetParameterInt("ColorID", j-1)
      cRoot.FindSubContainer("ContainerHoldingThePieChartPlugin").GetGeometryPluginInstance().SetParameterInt("Color",tmpColor)
    Next
    PieChart.PNG
    PieChartTemplate.PNG

    Comment


    • #3
      Ooohhh looks like what I need. Will try this for sure. As always thanks Lars!!!!

      Comment


      • #4
        Hi Lars,
        Getting an invalid argument error on the last line. Am i missing something?

        This is what i have:

        sub OnExecPerField()
        for j = 1 to 8
        dim tmpMaterial as Material = this.FindSubcontainer("PieColor_" & j).Material
        dim tmpColor as Color = cColor(tmpMaterial.Emission.Red, tmpMaterial.Emission.Green, tmpMaterial.Emission.Blue,1)

        FindSubContainer("PieChart").GetGeometryPluginInstance().SetParameterInt("ColorID", j-1)
        FindSubContainer("PieChart").GetGeometryPluginInstance().SetParameterInt("Color",tmpColor) ***Getting error***

        Next
        end sub
        Last edited by Shotski2; 11-09-2021, 11:05 PM.

        Comment


        • #5
          Figured out the issue: Changed ParameterInt to ParameterColor and it worked. Thanks again Lars

          Comment

          Working...
          X