almost works
almost works
![vbierschwale](https://secure.gravatar.com/avatar/672fb8deee738a0ca564162f839ab910/?default=https%3A%2F%2Fvanillicon.com%2F672fb8deee738a0ca564162f839ab910_200.png&rating=g&size=120)
I found this example
https://datatables.net/blog/2020/highcharts-integration#Charting-with-Data-Processing
Works great, but it uses averaging, so if you look at the value for the year 2009 in my example, this should be a negative number.
https://guestworkervisas.com/oescalculate.php?oes=47-0000&submit4=Submit
How do I correct that?
Thank You,
Virgil
Answers
This code is used to build the sums and remvoe extra characters like the
$
and,
:It also removes the
-
for the negative number as it is only looking for characters 0 through 9 and.
. Update both regex expressions to also include the dash (it needs escaped with the backslash. Something like this:Kevin
Thanks, I'm getting better with your product, but still have a long way to go.
That did take care of that portion of the problem, but the chart does not show the negative amount.
It only shows the positive amounts.
What should I look study to help me decipher this stuff.
I'm a old school programmer, so I can figure out most, but I struggle on this.
ok, never mind, I figured it out, and thank you for your help
Glad you got it working.
Kevin
I'm trying to add in a second column.
I have it added to the datatable
How do I add a second bar?
Been looking for examples, but it is hard to find them with datatables in the example code format.
https://guestworkervisas.com/oescalculate.php?oes=15-0000&submit4=Submit
The right column, in the top datatable.
I would start by looking at the Highcharts column chart docs. Look at the JSFiddle or Codepen example for the type of chart you want. Looks like you need an array of objects defining each series, from the example:
Instead of a single object for the series, in example you have this:
You will need to create an array of columns more like this:
You could create a new function similar to
getSalaries()
to compile the visas column. To eliminat code duplication you could make a generic function and add an additional parameter defining each column to compile, for examplefunction getColumnData(table, columns) {
.columns
would be an array of columns to iterate and compile.Kevin
thank you,
virgil