Testing CGraphic - questions and suggestions - page 2

 
o_O:

I don't think you were talking about "pixels".

You only submitted a Y array. So X is a simple sequence number. The output of GetX is correct.

The description clearly says "coordinates". I understand that coordinates are pixels.
 
Vladimir Karputov:
The description clearly says 'coordinates'. I understand that coordinates are pixels.
no, coordinates should not be associated with pixels.
 
o_O:
no, coordinates with pixels should not be related.
Then there is no relationship to what is drawn (the actual value of double) and the coordinates in pixels. I'll wait for clarification.
 
Vladimir Karputov:
Then there's no relationship to what's rendered (actual value of double) and coordinates in pixels. I'll wait for clarification.

Nah, that's a good point.

After all, you only gave one array - Y. It had to auto-calculate the points for X as ordinal.

Give CurveAdd a two-dimensional array. for example on X let it be time (which is logical in principle to get tick values). let's see the result.

---

Getting pixel coordinates is another matter. Look at the rendering code (or where the curve point calculation is done). How it calculates pixels. Maybe that array is stored.

 
o_O:
      //--- trim the name
      m_canvas.FontSizeSet(m_history.name_size);
      if(m_canvas.TextWidth(name)>m_history.name_width)
        {
         while(m_canvas.TextWidth(name+"...")>m_history.name_width)
            name=StringSubstr(name,0,StringLen(name)-1);
         name+="...";
        }

Found a bug - infinite while loop when m_history.name_width is small


How do I disable this History on the right side altogether?

Thanks for the post, we'll fix it. There is no direct way to disable history at the moment, but you can set curve name size HistoryNameWidth and its designation HistorySymbolSize to zero.
 
Roman Konopelko:
Thanks for the post, we'll fix it. There is no direct way to disable history at the moment, but you can set the size of HistoryNameWidth curve name and its designation HistorySymbolSize to zero.

virtual functions?

I need in my descendant to redefine histogram rendering function - I need two colours - for positive and negative values. And everything is not virtual, I can't redefine it (

 

@Roman Konopelko

Please explain how to read

GetX

Writes X coordinates for all curve points into an array


- is it the COORDINATE (x,y) in pixels or is it the value passed to draw the curve?

 
Vladimir Karputov:

@Roman Konopelko

Please explain how to read

GetX

Writes X coordinates for all curve points into an array


- is it the COORDINATE (x,y) in pixels or is it the value passed to draw the curve?

The GetX and GetY methods are implemented in the CCurve class and allow you to get the coordinates of the curve that were used to construct it.
 
Roman Konopelko:
The GetX and GetY methods are implemented in the CCurve class and allow you to get the coordinates of the curve that was used to create it.
Please write in help - . allow to get data based on which the curve was built. Because the word "coordinates" has a very similar meaning to the word "pixels".
 

@Roman Konopelko.

in CalculateXAxis()

lacks format as for date/time TimeToString

have only formatting for double values StringFormat.

string xformat=m_x.ValuesFormat();
m_xvalues[i]=(xformat==NULL) ? StringFormat("%7g",x) : StringFormat(xformat,x);

options:
- add CAxis::m_bdatetime variable - which will tell you to call the TimeToString function when formatting instead of StringFormat
- or take out

string xformat=m_x.ValuesFormat();
m_xvalues[i]=(xformat==NULL) ? StringFormat("%7g",x) : StringFormat(xformat,x);

into a separate virtual function, and let the user override it.

Thanks in advance.

PS. What news on the class and previous bugs?
Will there be any news or edits in the new build?

If you have new versions, please drop them here, without waiting for the publication of the build.

Reason: