What are the jqplot default series colors? - jqplot

I'm plotting some data on a jqPlot pie chart, and would like to get at the slice colors.
I'm aware of the possibility to set the slices to colors I set myself. I want to avoid this because the default colors contrast nicely from one to the next slice. Also, the slices highlight on mouse-over, and these highlight-colors are also good looking in the whole. It seems too much work to create a whole new color-scheme and then apply it to the plot when jqPlot already has a good thing built in.
I want to get at the slice colors, because I need to give additional information on certain slices, and will do this outside the plot. Re-using the slice colors would additionally allow me to forego using a legend in the plot itself, and creating my own table with "slice color - name - additional information" which then serves both as legend and source of additional information.
Is there a source of the default colors somewhere? Or is there a way to programmatically extract them?

Ok, managed to find it by delving in the actual code, as the info in the documentation on the website of jqPlot is out of date on this.
For other people wanting to get the default colors:
jquery.jqplot.js, line 354: defaultColors: [ "#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"]
jquery.jqplot.js, line 355: defaultNegativeColors: [ "#498991", "#C08840", "#9F9274", "#546D61", "#646C4A", "#6F6621", "#6E3F5F", "#4F64B0", "#A89050", "#C45923", "#187399", "#945381", "#959E5C", "#C7AF7B", "#478396", "#907294"]
The highlight colors are generated automatically in the function $.jqplot.computeHighlightColors (line 3775 of jquery.jqplot.js). I haven't deduced the actual highlight colors as I don't need them for my purposes, but if anyone else is looking for them, that's where you can start from.
(Line numbers based on version 1.0.8, revision 1250.)
As far as I can tell & also according to the documentation, when the array is exhausted, the colors starts over from the beginning.

According to Gimp colorpicker, jqPlot default series colors used in this example are - clockwise from orange to blue :
#eaa228 - (#efbc67 if highlighted),
#c5b47f - (#d5c9a4 if highlighted),
#579575 - (#88b39d if highlighted),
#839557 - (#a7b388 if highlighted),
#958c12 - (#b3ad58 if highlighted),
#4bb2c5 - (#80c8d5 if highlighted).
Hope it will help you.
EDIT : Please see in this link default series colors specified by jqplot

Related

Telerik Reporting Chart

I am trying to build report using Telerik report designer and not able to identify if charts in below format are supported, if supported which chart type we have to use and which property will fill in color between low and high
candlestick , range chart only displays lines (2nd image)
For the candlestick, it looks like a configuration issue. Please, check these things:
High, Low, Open, Close are not properly set
The data source fields that are used are not of numeric type (i.e. hold numerics as strings)
As for coloring the candlestick, check DataPointStyle property. there you can either set BackgroundColor directly, or use DataPointConditionalFormatting in order to add dynamic formatting based on the underlying data.
I am not sure what is the chart in the first picture, can you please shed some more light on its purpose?

ZPL - how to right justify a bar code?

I am trying to right justify a bar code I am printing using ZPL from a .Net program. Here is my current code:
^FO10,50^FB500,1,0,R,0^AO,40,40^BY3^BCN,100,Y,N,N^FD1234567^FS^XZ
The Field Block seems to be ignored when working with a bar code, but for text it justifies it correctly. Any ideas?
Newer Zebra firmware supports a third parameter on ^FO and ^FT. If you want to right justify something, specify the right edge as the x parameter, and include a 1 as the third parameter.
^XA
^BY3
^FO85,30^GB500,450,3^FS
^FO100,50^BCN,30,Y,N,N
^FD>;12345678^FS
^FO100,120N^BCN,30,Y,N,N
^FD>;123456^FS
^FO100,190^BCN,30,Y,N,N
^FD>;1234^FS
^FO570,260,1^BCN,30,Y,N,N
^FD>;12345678^FS
^FO570,330,1^BCN,30,Y,N,N
^FD>;123456^FS
^FO570,400,1^BY3^BCN,30,Y,N,N
^FD>;1234^FS
^XZ
We had the same issue at our company. The barcode doesn't respond to the Field Block. Based on your example since you are using ZPL commands directly to generate your barcode (as opposed to an image of a barcode), you could do something similar to how we did. We know roughly how wide the barcode is going to be based on the data we write to it. So we created a method to determine the x-axis location of the barcode based on our also known label widths.
For example: We use the s4M printers and estimate the full label width to be about 780 dots wide. So in order to left/center/right justify, we take the rough barcode (estimated) width and calculate accordingly (left is set to xaxis = 0, center is set to xaxis = ((780 - barcodeWidth) / 2), and right justified would be xaxis = (780 - barcodeWidth). It isn't a perfect solution but is very close at least for our needs. You could certainly be more precise in your algorithm by looking at more barcode setting information like the data square size, columns, rows, etc... depending on your needs.
If you were to come up with a solution of generating an image of a barcode (which is what we are also trying to come up with now) then you should be able to easily get the width of the barcode image using build in .net graphics functionality.

how is the calculation of rgb values done in the dialog "windows color and appearance"

In Windows 7 and Windows XP you can find the "Window Color and Appearance" dialog under "Control Panel\Appearance and Personalization\Personalization".
Changing "Color1" of item "3D-Border" will result in a change of the following entries in the registry key
[HKEY_CURRENT_USER\Control Panel\Colors]
containing the resulting rgb-values:
Group1 (same values):
InactiveTitle, AppWorkspace, ButtonShadow, Graytext
Group2 (same values, different to those of group1):
Scrollbar, ButtonHilight
Does anyone know how these value are being calculated from the given rgb-values of "Color1"?
After searching the web without results and playing around with many values I did not happen to find a plausible way of how to do this.
Does anyone know the rules for this?
Any help would be appreciated.
I uploaded some demo values, systematically dealing with values in the lower parts. Also a text file comparing the affected registry key [HKEY_CURRENT_USER\Control Panel\Colors] after change of Color to Red (255 0 0).
When you set the "3D Border" color to red, it changed the "Button Face" color to red and interpolated this color to generate various lighter and darker shades of red, which were used to set some related color values.
The point is to create a consistent-looking theme with minimal effort. All you need to do is set the "base" color for 3D objects, and all of the other colors are automatically calculated to ensure that objects have the appropriate 3D appearance.
Some of these values, like the highlight and shadow colors used for 3D objects, are not directly configurable from the control panel applet. However, they can be set manually in the registry, and you can call the SetSysColors function to update currently running applications.
Why do you think you need to know the actual algorithm that Windows is using? What problem are you trying to solve? What are you going to use this information to do?
I do not imagine that the exact algorithm is documented anywhere. The code has been part of the OS since at least Windows 95.

Dynamically apply different y-axes to data in a jqplot

I'm trying to create a jqplot with multiple lines plotted on it, where the number of data series depends on user input.
Now I want to use two different y-axes for certain kinds of results, but the jqplot documentation only shows how to assign different y-axis to series in a static way.
Is there a dynamic solution?
you will need to change the option string when ever you need to have different y axises, But still you will need to re draw the chart as well..

Highlight a value on an axis

I would like to highlight a single value on an axis; similar to the way that stock charts display the live price on the axis.
You could use an annotation tool to show a textbox with the value and a color line tool if you also want to have vertical/horizontal line highlighting the value. However, both tools are only available with the Pro version, and these are two features that would be quite easy to achieve with custom drawing techniques at OnAfterDraw event.
Yeray Alonso
Steema Support Central

Resources