Define which set of chart templates to use

Modified on Mon, 5 Oct at 1:54 PM

If a client has several sets of chart templates, it can be handy to include a user setting to define which set of these chart templates to use when inserting a chart. For instance, if different departments have different templates. An example of usage can be seen that has three different sets of templates. Here, the options are configured as toggle buttons so the user can see what is currently selected.

It works by reading a registry key that overrides which Content folder in Alloy it should look for the template in. For instance, if the user sets the chart to "Standard", the command for inserting a chart will then grab the folder called SkabelonDesign.CorporateCharts3, since this is defined as the value in both the toggle button and command.

XML
<Menu label="Set charts" icon="ChartFormatAxis" >
  <ToggleButton label="Standard" 
                pressed="BaseExtensions:any" 
                pressed-1-type="REGISTRY"
                pressed-1-key-1="Software\Alloy" 
                pressed-1-key-2="SDCharts3.Redirect" 
                pressed-1-value-1="SkabelonDesign.CorporateCharts3">
    <True>
      <Cmd case="BaseExtensions:update-registry" path="Software\Alloy" name="SDCharts3.Redirect" type="string" valueDefault="SkabelonDesign.CorporateCharts3"/>
    </True>
    <False>
    </False>
  </ToggleButton>
  <ToggleButton label="IB CSS (Axes, Plain)" 
              pressed="BaseExtensions:any" 
              pressed-1-type="REGISTRY"
              pressed-1-key-1="Software\Alloy" 
              pressed-1-key-2="SDCharts3.Redirect" 
              pressed-1-value-1="SkabelonDesign.CorporateCharts3-IBCSS">
    <True>
      <Cmd case="BaseExtensions:update-registry" path="Software\Alloy" name="SDCharts3.Redirect" type="string" valueDefault="SkabelonDesign.CorporateCharts3-IBCSS"/>
    </True>
    <False>
    </False>
  </ToggleButton>
  <ToggleButton label="IB Research (Axes, Gridlines)" 
                pressed="BaseExtensions:any"
                pressed-1-type="REGISTRY" 
                pressed-1-key-1="Software\Alloy" 
                pressed-1-key-2="SDCharts3.Redirect"
                pressed-1-value-1="SkabelonDesign.CorporateCharts3-IBResearch">
    <True>
     <Cmd case="BaseExtensions:update-registry" path="Software\Alloy" name="SDCharts3.Redirect" type="string" valueDefault="SkabelonDesign.CorporateCharts3-IBResearch"/>
    </True>
    <False>
    </False>
  </ToggleButton>
</Menu>

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article