How to represent Zeros and Nulls in white color

TeeChart for Javascript for the HTML5 Canvas
Post Reply
vishwa
Newbie
Newbie
Posts: 33
Joined: Mon Oct 15, 2007 12:00 am

How to represent Zeros and Nulls in white color

Post by vishwa » Tue Sep 11, 2018 7:05 am

Hi,

I'm using Color grid for tee chart. I want to represent Zeros and nulls in white color using color palette or in different way. Can anyone help on this how to plot colorgrid nulls and zeros with white color.

Regards,
PSKN

Yeray
Site Admin
Site Admin
Posts: 8497
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to represent Zeros and Nulls in white color

Post by Yeray » Wed Sep 12, 2018 11:04 am

Hello,

You could redefine the getColor function adding a condition to return the white color when you want. Ie:

Code: Select all

  colorGrid.oldgetColor=colorGrid.getColor;
  colorGrid.getColor=function(value) {
    if ((value === null) || (value === 0)) {
      return { r: 255, g: 255, b: 255, a: 0 };
    }
    return colorGrid.oldgetColor(value);
  }
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply