Results 1 to 2 of 2

Thread: Develop Chart Theme

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Vote Rating

    Default Unanswered: Develop Chart Theme

    Hi all!

    I need to develop general theme to use in several types of charts (pie, column, etc.).

    The ptoblem is that I need to change the colors of the series- based on the number of series I have in the chart in real-time.

    Colors for chart series is determined by the chart base color provided in the theme defaults. Default base color is then used to calculate the colors for other series as needed. These calculations are based on dividing the hue value by the number of series colors needed. Saturation and lightness values are not changed.

    My base color is: HSL: Hue=210deg; Saturation=43%; Lightness=55% , HEX: # 5588BB

    For multi series charts the hue value (0 360 deg) will be divided by the number of required series distributing the colors across the spectrum.

    For example:

    3 series chart: 360/3=120, so:
    base heu is: 210deg.
    slice 2: H210+120deg= H300.
    slice 3: H300+120deg=H90.

    7 series chart: 360/7=~52, so:
    base heu is: 210deg.
    slice 2:H210+52deg=H262.
    slice 2:H262+52deg=H314.
    slice 2:H314+52deg=H6.
    slice 2:H6+52deg=H58.
    slice 2:H58+52deg=H110.
    slice 2:H110+52deg=H162.

    and so on...

    It is not simple, I know.

    Any idea? it will be helpful!!!

    Many thanks.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    In the constructor, if you can get the chart's number of series then you can set what you want or you can pass int he number of series. Not sure if you can do it dynamically like you want... haven't seen it done before.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts