
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
And immediately a wish: I can make a slanted (angled) font for both axes at once (my_graphic.FontSet("Arial",10,0,180);). Can't we make this font (or angle) setting method for a separate axis?
Afternoon! To change the axis font slope you would need to add three new fields and six new methods to the CAxis class to maintain them, and it already looks a bit overloaded at the moment. So I can't say whether such functionality will be added or not. In your case, I can advise to implement CGraphics descendant and override CreateAxes method in it (rewrite literally two lines).
Could you please tell me how to add text to a scientific chart? No matter how I tried, it didn't work. Here's the slightly modified code from the example:
In general, thank you very much that there are "numerous" examples onCGraphic!!!
You have to spend a lot of time on some small things, until you spit and swear and throw it all to hell...
Actually, thank you very much for the "numerous" examples on CGraphic!!!
But there are examples, e.g. https://www.mql5.com/ru/articles/2866 and https://www.mql5.com/ru/docs/stand ardlibrary/mathematics/stat
Few. And I didn't find TextAdd() or LineAdd() there.
Few. And I didn't find either TextAdd() or LineAdd() there.
Good afternoon! The solution to your problem lies in these lines:
Among additional capabilities of the Graphics library we should also mention methods that allow you to add new elements to the chart:
- TextAdd()- adds text to an arbitrary place on the chart, the coordinates must be set to real scale. Use FontSet method to fine-tune the displayed text.
- LineAdd() - adds a line to an arbitrary place on the chart, the coordinates must be set to real scale.
- MarksToAxisAdd() - adds new marks on the specified coordinate axis.
It is important to note that the data on adding these elements is not stored anywhere, therefore, after drawing a new curve on the chart or redrawing it, they will all be overwritten.You call the graphic.CurvePlotAll() method to overwrite the text you wanted to draw. The correct way to do this is as follows:
Result:
Roman Konopelko, thank you very much!
Yes, I think such peculiarities of work with graphics should be specified in the Documentation.
The question for connoisseurs is this. There is a tick chart based on a scientific CGraphic.
It needs:
1) indent as on the graph in MT. So that the last values are not adjacent to the right border of the graph;
2) Display the Y-scale on the right instead of the left.
I couldn't find such features in the methods...
Dennis Kirichenko:
The following is needed:
1) Indent as in the MT graph. So that the last values are not adjacent to the right border of the graph;
//---
An example of what this looks like:
Dennis Kirichenko:
Need:
...
2) Display the Y scale on the right instead of the left.
There is no such option. It would be nice if it were possible not only to place the scale on the right, but also to display two independent scales (main and auxiliary), as you can do, for example, in Excel:
Anatoly, thank you very much! It helped in point 1. Yes, I missed theCAxis::MaxGrace(const double value) axis method.