Can you please check what is wrong with the float number in charts? It is showing way more decimal points than the one I set. In wpdatatables, I set it to allow 2 decimals, in the phpmyadmin, I also set the type to be float (16,4) [and also change to float (16,2) but both won't work either]
I can't provide the login information but I definitely can provide as much information as possible.
Unfortunately we are aware of this issue and it is in our TODO list for next updates. Sorry for any inconvenience we will need to fix this and I will let you know when we have the solution.
In file /var/www/wpdt.plugin/wp-content/plugins/wpdatatables/source/class.wpdatachart.php you can take a look where the all logic is. First you will need to add a this
$decimalPlaces= get_option('wdtDecimalPlaces');
And then change it in render data in case there is a float.
Keep in mind that for different chart engines for example Google charts you will need to set and change the code for their tooltips.
I made some custom solution for highcharts so if you are interested we can give you a quote for it.
Thanks for your reply. Currently all of my charts use highchart so I would definitely hope to have a fix for this issue. I am not sure where I put the line of code in, would you mind to show me where? Is it at the place where I snapshot? (see attachment)
Thanks for your reply. Unfortunately, the long decimal point is still there after I make changes at these two 'float' case parts and clean a thorough browser cache.
Strange, I change the code just like I told you in the post below and the chart respects the decimal places which are set in wpdatatables settings page. ( attachments)
Decimal places is set to 4 but on the first attachment the number is 234.0100 and because the two zeros in the end it displays like this 234.01.
If you are not in hurry I will ask Milos when he comes from the vacation, he made almost the whole wpdatacharts so maybe he can give you some better solution but for sure this is on our list to implement it for next updates.
I tested on my end, I set the decimal point to 5 and it still doesn't affect the rendering float value on the graph. It is still displaying the same as before, so I guess that is not the case. By the way, the current version that I am using is 1.7.2, not sure if that helps.
I think it is the issue with the wpdatatables_highcharts.js in assets/js/wpdatatables/
I haven't figured out yet, but I think that is something to do with tooltip point format. Not sure what it is, but if you have the solution already, please let me now, vice versa!
Thanks for your help though!
UPDATED: I just checked. It happens when I have group float values. Here is one example that caused the issue:
1 entry : 773.01, show in total: 773.01
7 entry: 773.01 + 4955 + 825 + 1900 + 1300 + 2400 + 3800 , show in total: 15953.01
8 entry: (same as above) + 16700, show in total: 32653.01000000002 <<<<<
Ok, I will forward this to my team and as soon as we have a proper solution I will get back to you. Probably next week because all of my colleges from my team are on vacation this week, so I will need some time.
I actually found a workaround, if anyone is interested, you can add the following line of code into assets/js/wpdatatables/wpdatatables_highcharts.js (.min.js if you are using minified js)
At around line 520:
for(var n in seriesDataEntry[i]) { if( n != 'name'){ output[value_key][n] += seriesDataEntry[i][n]; output[value_key][n] = parseFloat(output[value_key][n].toFixed(2)); <<< fixed the multiple decimals } }
Note: this is for highcharts, but the other charts should or can be fixed this way as well.
Dear devs,
Can you please check what is wrong with the float number in charts? It is showing way more decimal points than the one I set. In wpdatatables, I set it to allow 2 decimals, in the phpmyadmin, I also set the type to be float (16,4) [and also change to float (16,2) but both won't work either]
I can't provide the login information but I definitely can provide as much information as possible.
Thanks all!
Hi issacchua,
Thank you for your purchase.
Unfortunately we are aware of this issue and it is in our TODO list for next updates.
Sorry for any inconvenience we will need to fix this and I will let you know when we have the solution.
Best regards.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Bogdan,
Thanks for your reply. Any chance that you show me where exactly the line of code is so that I can fix it myself?
Thanks a lot!
Hi issacchua,
In file /var/www/wpdt.plugin/wp-content/plugins/wpdatatables/source/class.wpdatachart.php you can take a look where the all logic is.
First you will need to add a this
And then change it in render data in case there is a float.
Keep in mind that for different chart engines for example Google charts you will need to set and change the code for their tooltips.
I made some custom solution for highcharts so if you are interested we can give you a quote for it.
Best regards.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Bogdan,
Thanks for your reply. Currently all of my charts use highchart so I would definitely hope to have a fix for this issue. I am not sure where I put the line of code in, would you mind to show me where? Is it at the place where I snapshot? (see attachment)
Thanks man, you are so awesome!
Hi issacchua,
Yes it is after the case float , it should look like this
Let me know if you managed to implement it.
Best regards.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Bogdan,
Thanks for your reply. Unfortunately, the long decimal point is still there after I make changes at these two 'float' case parts and clean a thorough browser cache.
Anywhere else to fix and change?
HI issacchua
Can you please try to follow this example
in ../wp-content/plugins/wpdatatables/source/class.wpdatachart.php line around line 1713 you will find this code
I added this line
then in line 1754 change the code to look like this
Let me know the result.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Bogdan,
I tried your way and still no luck. Ain't it the same way if I just set the decimal to 2 in my previous reply?
Hi issacchua,
Strange, I change the code just like I told you in the post below and the chart respects the decimal places which are set in wpdatatables settings page. ( attachments)
Decimal places is set to 4 but on the first attachment the number is 234.0100 and because the two zeros in the end it displays like this 234.01.
If you are not in hurry I will ask Milos when he comes from the vacation, he made almost the whole wpdatacharts so maybe he can give you some better solution but for sure this is on our list to implement it for next updates.
Thank you for understanding.
Best regards.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Bogdan,
I tested on my end, I set the decimal point to 5 and it still doesn't affect the rendering float value on the graph. It is still displaying the same as before, so I guess that is not the case. By the way, the current version that I am using is 1.7.2, not sure if that helps.
I think it is the issue with the wpdatatables_highcharts.js in assets/js/wpdatatables/
I haven't figured out yet, but I think that is something to do with tooltip point format. Not sure what it is, but if you have the solution already, please let me now, vice versa!
Thanks for your help though!
UPDATED: I just checked. It happens when I have group float values. Here is one example that caused the issue:
1 entry : 773.01, show in total: 773.01
7 entry: 773.01 + 4955 + 825 + 1900 + 1300 + 2400 + 3800 , show in total: 15953.01
8 entry: (same as above) + 16700, show in total: 32653.01000000002 <<<<<
Hi issacchua,
Ok, I will forward this to my team and as soon as we have a proper solution I will get back to you.
Probably next week because all of my colleges from my team are on vacation this week, so I will need some time.
Thank you for your understanding.
Best regards.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thanks Bogdan,
I will be waiting for your reply. Thank you very much!
Hi Milos,
May I know how is the progress with this issue?
Thanks !
Hi guys,
I actually found a workaround, if anyone is interested, you can add the following line of code into assets/js/wpdatatables/wpdatatables_highcharts.js (.min.js if you are using minified js)
At around line 520:
for(var n in seriesDataEntry[i]) {
if( n != 'name'){
output[value_key][n] += seriesDataEntry[i][n];
output[value_key][n] = parseFloat(output[value_key][n].toFixed(2)); <<< fixed the multiple decimals
}
}
Note: this is for highcharts, but the other charts should or can be fixed this way as well.
Hi issacchua,
Well done on finding the solution, i will definitely note this so we can implement it for future versions and for updating the other charts.
I will try to forward this and add it in 2.0 version so when the beta is out this will be implemented.
Thank you for your suggestions.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables