Jump to content
  • JavaScript Color Picker for Spotfire


    Here is a simple way to convert a regular input Spotfire Control as a color picker. The approach is similar to the JavaScript Date and Time Pickers for Spotfire

    colorpicker.gif.7c9af87e90b169e26b234d9096e2ee9b.gif


    Create an Input field Property Control  by editing a text area in HTML mode and wrap the Spotfire control with a span element and some identifier and add the ColorPicker.js JavaScript to the text area

    image.png.87bcb0a23558276c0bd0c85ea3af01e8.png

     

    html

    <span id="color">
       <SpotfireControl id="this is an input-field string dp control " />
    </span>



    ColorPicker.js

    colorInput = document.querySelector("#color input")
    colorInput.type="color"

     

    Congratulations! Now you have a color picker.. but now what? Here is a use case in which you could use this color picker

     

    Back to the JavaScript Component Hub for Spotfire

    Disclaimer

    This method makes assumptions about the inner workings of Spotfire version 12.0.0 LTS Any analyses created using this hack may cause instability and performance issues and are likely to break when Spotfire is upgraded or hotfixed in the future.  Any issues resulting from applying this hack are not covered by Spotfire maintenance agreements and Support will not assist in troubleshooting problems with analysis files where this approach is used.

    • Like 2

    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...