Customization precedence
The library offers multiple approaches to modify the chart's appearance and behavior. This article lists these approaches and demonstrates an example to clarify their order of precedence.
Approaches
The table below provides an overview of customization methods/properties and their order of application. The methods/properties higher in the table will override any styles applied by the methods/properties lower on the list.
Methods/Properties | Description | Order |
---|---|---|
# | Applies overrides to the chart without reloading. Refer to Overrides for more information. | 1 |
# | Loads the chart state from an object when the chart is initialized. Refer to the Low-level API section for more information. | 2 |
# | Sets an object that contains saved chart content. Refer to the Widget Constructor tutorial on YouTube for an implementation example. | 3 |
# | Overrides chart settings loaded from a custom settings adapter or a local storage. Refer to the Widget Constructor tutorial on YouTube for an implementation example. | 4 |
# | Allows creating your custom settings adapter to save user settings to your preferred storage, including server-side. Refer to the Save user settings article for more information. | 5 |
# | Allows storing chart settings in the browser's local storage via the Storage object. You can disable storing properties in the local storage by using the use_localstorage_for_settings featureset. | 6 |
# | Overrides default values of the widget properties. Refer to Overrides for more information. | 7 |
# | Overrides default colors of the light and darks themes. Refer to Custom themes API for more information. | 8 |
Example
You can check out the following example to understand how these approaches override each other. Change the flags' values provided at the beginning of the JavaScript file (lines 1-7) to easily manage the example.
The coloring of the candle bodies will vary based on the approach applied. Below, you will find the colors associated with each method/property.
applyOverrides
→ orangeload
→ bluesaved_data
→ redsettings_overrides
→ purplesettings_adapter
→ greenlocalStorage
→ blackoverrides
→ yellow