Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ScatterDraw & ScatterCtrl » Ideas: Grid lines at "round" dates or values. More options for tooltip.
Re: Ideas: Grid lines at "round" dates or values. More options for tooltip. [message #52249 is a reply to message #51787] Fri, 16 August 2019 11:35 Go to previous messageGo to previous message
Maginor is currently offline  Maginor
Messages: 39
Registered: May 2019
Member
Hi, it almost works now. It is correct initially, but when I pan the plot sideways the grid lines slide in the wrong direction, while the text reticles are correct (and so become unaligned with the grid lines).

As far as I can see from the code in ScatterDraw::Plot, it seems like the grid lines are drawn with reference to the right of the plot instead of the left?

Here is an example callback where this happens.
void PlotCtrl::UpdateDateGridLinesX(Vector<double> &LinesOut)
{
	//InputStartDate is X=0. X resolution is daily
	
	double XMin = Plot.GetXMin();
	double XRange = Plot.GetXRange();
	
	Date FirstDate = InputStartDate + (int)XMin;
	int FirstYear = FirstDate.year; //+1?
	Date LastDate = FirstDate + (int)XRange;
	int LastYear = LastDate.year;
	
	Date IterDate(FirstYear, 1, 1);
	for(int Year = FirstYear; Year <= LastYear; ++Year)
	{
		IterDate.year = Year;
		double XVal = (double)(IterDate - InputStartDate) - XMin;
                if(XVal > 0 && XVal < XRange)
		        LinesOut << XVal;
	}
}


(Plot is a ScatterCtrl, InputStartDate is just a reference date for X=0).
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Remove a Surf from a ScatterDraw
Next Topic: ScatterDraw data ownership
Goto Forum:
  


Current Time: Fri Oct 22 23:29:56 CEST 2021

Total time taken to generate the page: 0.01060 seconds