Highlight a value on an axis - teechart

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

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.

What are the jqplot default series colors?

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

Visual FoxPro - Table Grid

How can I achieve this kind of grid? What controls/tools I should use? Any idea?
This screen cast is from the Baplie Viewer application. I guess it was done by the captain using visual foxpro while he was sailing.
[Edit]
It is ready-only and column widths will be fixed. It is a kind of reporting generated in a tabular format similar to Grid, but I think we cannot use the native Grid control.
And it may be needed to generate dynamically. I mean we would not be able to use shape tools, line tool, etc. in design time.
Is the grid editable? Or readonly?
A VFP grid control can take any of the VFP controls as the column control source. For example, the "Total" row may be two columns. The second column could contain another VFP grid as it's control source. While the first column is just a textbox or label.
Or, this grid could be readonly and created by using the Line or Shape controls, coloring their areas and using labels to represent the data.
If you are interested in using third party controls like this, I would recommend DBI-Technologies. They have a large selection of custom controls that work with VFP.
That's not a grid control, or a FoxPro control of any type. (Or, at least, that's not the best way to get that effect.) It's a webview control bound to an HTML web page, generated in the background and then displayed most likely via a temporary file.
The easiest way to achieve the effect in a FoxPro application is to use the CUROSRTOXML function and a XSLT transformation.

How do I get FoxPro to snap-to-grid on an English report layed out in Metric?

So I've recently had to create a report that emulates a Canadian customs form. The problem is that the report is printed on 11" x 14" paper, but uses a metric layout. As my FoxPro installation is on a machine with US-English units-of-measure, FoxPro tries to oblige by using an English ruler, and doing snap-to-grid on inch-based measurements. This creates some minor design issues obviously.
I understand that the reports are really just tables in disguise, and I have figured out how to turn on the Metric ruler (instead of the English one) by changing a record, and that is working as intended. However, the snap-to-grid functionality appears to want to snap on 48 units-to-an-inch, instead of something Metric. So moving a box around using a mouse results in the box being offset (again) in English measurements.
To get around this, I have taken to openning up the report as a table and manually converted all Metric units with a spreadsheet, and entered the offsets and sizes by hand. While this has worked well and appears to be very accurate, it's still error-prone.
So the question is, how do I get FoxPro 8 to snap-to-grid in Metric units on the report, so that I don't have to keep re-entering numbers by hand? It would be nice to get FoxPro to accomodate Metric in a fashion where I can align objects in the report using a mouse, rather than punching them in as numbers and "flipping" the report into design view to check it.
For reference, currently there are the following translations:
25.4 mm = 1 inch = 10,000 report units = 48 grid snap points
Obviously I'd like something closer to this:
25.4 mm = 1 inch = 10,000 report units = 25.4 grid snap points
Note: Yes, I have considered setting up a Virutal Machine with FoxPro that uses a Metric install, i.e. a Windows XP install set up for Canada. However, that will take another day or so to get the installation done, along with the rest of the development environment, so I'm trying to avoid that.
Hidden unless you've been exposed to more of it...
Modify your report.
Right-click, get to properties of the report.
On the tab for Ruler / Grid, there is a combobox which is defaulted to ruler of "inches", but you can change it to Metric/cm or Pixels. Below that is your grid snap and you can change the default of how many pixels to snap to.
Additionally, if you use your cursor keys, you can move the controls one pixel at a time for more precise alignments as needed. And if you need to resize a control's width, if you hold the Ctrl key down and use the arrow keys left/right, will shrink / strecth one pixel at a time instead of moving the control. Likewise for the moving and sizing if you pick multiple controls, they will ALL move or resize respectively.
HTH
Just spoke with a freind lastnight who has VFP8 installed. Based on that version, there MIGHT be a way to get metric for your reports. There is a setting on the reports from showing based on PIXELS, or SYSTEM METRIC. If you system configuration is based on inches, so too is the report. If you change your system metric to that of centimeters (or whatever equivalent it would be), so too should the report respect in design time.
HTH

Resources