mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-05 17:44:55 -06:00
ScatterDraw: Now runs on 64 bits too. Included bug fixes and SetLegendWidth()
git-svn-id: svn://ultimatepp.org/upp/trunk@5769 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
cfec8c73f0
commit
87558ba01d
4 changed files with 103 additions and 100 deletions
|
|
@ -14,7 +14,7 @@ double DataSource::Min(Getdatafun getdata)
|
|||
}
|
||||
return minVal;
|
||||
}
|
||||
|
||||
|
||||
double DataSource::Max(Getdatafun getdata)
|
||||
{
|
||||
double maxVal = DOUBLE_NULL;
|
||||
|
|
|
|||
|
|
@ -5,15 +5,16 @@ NAMESPACE_UPP
|
|||
|
||||
class DataSource {
|
||||
public:
|
||||
typedef double (DataSource::*Getdatafun)(int id);
|
||||
typedef double (DataSource::*Getdatafun)(ptrdiff_t id);
|
||||
|
||||
DataSource() : isParam(false) {}
|
||||
virtual ~DataSource() {};
|
||||
virtual double z(int id){return Null;};
|
||||
virtual double y(int id){return Null;};
|
||||
virtual double x(int id){return Null;};
|
||||
virtual int GetCount() {return Null;};
|
||||
bool IsParam() {return isParam;};
|
||||
virtual ~DataSource() {}
|
||||
virtual double z(ptrdiff_t id) {return Null;}
|
||||
virtual double y(ptrdiff_t id) {return Null;}
|
||||
virtual double x(ptrdiff_t id) {return Null;}
|
||||
virtual ptrdiff_t GetCount() {return Null;}
|
||||
virtual ptrdiff_t GetCount(int series) {return Null;}
|
||||
bool IsParam() {return isParam;}
|
||||
|
||||
virtual double MinX() {return Min(&DataSource::x);}
|
||||
virtual double MinY() {return Min(&DataSource::y);}
|
||||
|
|
@ -38,17 +39,17 @@ protected:
|
|||
class CArray : public DataSource {
|
||||
private:
|
||||
double *xData, *yData, *zData;
|
||||
int numData;
|
||||
ptrdiff_t numData;
|
||||
double x0, deltaX;
|
||||
|
||||
public:
|
||||
CArray(double *yData, int numData, double x0, double deltaX) : yData(yData), numData(numData), x0(x0), deltaX(deltaX) { xData = NULL; };
|
||||
CArray(double *xData, double *yData, int numData) : xData(xData), yData(yData), numData(numData) { zData = NULL; x0 = deltaX = 0; };
|
||||
CArray(double *xData, double *yData, double *zData, int numData) : xData(xData), yData(yData), zData(zData), numData(numData) { x0 = deltaX = 0; };
|
||||
virtual inline double z(int id) {ASSERT(zData); return zData[id];};
|
||||
virtual inline double y(int id) {return yData[id];};
|
||||
virtual inline double x(int id) {return xData ? xData[id] : id*deltaX + x0;};
|
||||
virtual inline int GetCount() {return numData;};
|
||||
CArray(double *yData, int numData, double x0, double deltaX) : yData(yData), numData(numData), x0(x0), deltaX(deltaX) { xData = NULL; }
|
||||
CArray(double *xData, double *yData, int numData) : xData(xData), yData(yData), numData(numData) { zData = NULL; x0 = deltaX = 0; }
|
||||
CArray(double *xData, double *yData, double *zData, int numData) : xData(xData), yData(yData), zData(zData), numData(numData) { x0 = deltaX = 0; }
|
||||
virtual inline double z(ptrdiff_t id) {ASSERT(zData); return zData[id];}
|
||||
virtual inline double y(ptrdiff_t id) {return yData[id];}
|
||||
virtual inline double x(ptrdiff_t id) {return xData ? xData[id] : id*deltaX + x0;}
|
||||
virtual inline ptrdiff_t GetCount() {return numData;}
|
||||
};
|
||||
|
||||
template <class Y>
|
||||
|
|
@ -57,10 +58,10 @@ private:
|
|||
Vector<Y> *yData;
|
||||
|
||||
public:
|
||||
VectorY(Vector<Y> &yData) : yData(&yData) {};
|
||||
virtual inline double y(int id) {return (*yData)[id];};
|
||||
virtual inline double x(int id) {return id;};
|
||||
virtual inline int GetCount() {return yData->GetCount();};
|
||||
VectorY(Vector<Y> &yData) : yData(&yData) {}
|
||||
virtual inline double y(ptrdiff_t id) {return (*yData)[id];}
|
||||
virtual inline double x(ptrdiff_t id) {return id;}
|
||||
virtual inline ptrdiff_t GetCount() {return yData->GetCount();}
|
||||
};
|
||||
|
||||
template <class Y>
|
||||
|
|
@ -69,10 +70,10 @@ private:
|
|||
Upp::Array<Y> *yData;
|
||||
|
||||
public:
|
||||
ArrayY(Upp::Array<Y> &yData) : yData(&yData) {};
|
||||
virtual inline double y(int id) {return (*yData)[id];};
|
||||
virtual inline double x(int id) {return id;};
|
||||
virtual inline int GetCount() {return yData->GetCount();};
|
||||
ArrayY(Upp::Array<Y> &yData) : yData(&yData) {}
|
||||
virtual inline double y(ptrdiff_t id) {return (*yData)[id];}
|
||||
virtual inline double x(ptrdiff_t id) {return id;}
|
||||
virtual inline ptrdiff_t GetCount() {return yData->GetCount();}
|
||||
};
|
||||
|
||||
class VectorDouble : public DataSource {
|
||||
|
|
@ -80,10 +81,10 @@ private:
|
|||
const Vector<double> *xData, *yData;
|
||||
|
||||
public:
|
||||
VectorDouble(const Vector<double> &xData, Vector<double> &yData) : xData(&xData), yData(&yData) {};
|
||||
virtual inline double y(int id) {return (*yData)[id];};
|
||||
virtual inline double x(int id) {return (*xData)[id];};
|
||||
virtual inline int GetCount() {return xData->GetCount();};
|
||||
VectorDouble(const Vector<double> &xData, Vector<double> &yData) : xData(&xData), yData(&yData) {}
|
||||
virtual inline double y(ptrdiff_t id) {return (*yData)[int(id)];}
|
||||
virtual inline double x(ptrdiff_t id) {return (*xData)[int(id)];}
|
||||
virtual inline ptrdiff_t GetCount() {return xData->GetCount();}
|
||||
};
|
||||
|
||||
class ArrayDouble : public DataSource {
|
||||
|
|
@ -91,10 +92,10 @@ private:
|
|||
const Upp::Array<double> *xData, *yData;
|
||||
|
||||
public:
|
||||
ArrayDouble(const Upp::Array<double> &xData, Upp::Array<double> &yData) : xData(&xData), yData(&yData) {};
|
||||
virtual inline double y(int id) {return (*yData)[id];};
|
||||
virtual inline double x(int id) {return (*xData)[id];};
|
||||
virtual inline int GetCount() {return xData->GetCount();};
|
||||
ArrayDouble(const Upp::Array<double> &xData, Upp::Array<double> &yData) : xData(&xData), yData(&yData) {}
|
||||
virtual inline double y(ptrdiff_t id) {return (*yData)[int(id)];}
|
||||
virtual inline double x(ptrdiff_t id) {return (*xData)[int(id)];}
|
||||
virtual inline ptrdiff_t GetCount() {return xData->GetCount();}
|
||||
};
|
||||
|
||||
class VectorPointf : public DataSource {
|
||||
|
|
@ -102,11 +103,11 @@ private:
|
|||
const Vector<Pointf> *data;
|
||||
|
||||
public:
|
||||
VectorPointf(const Vector<Pointf> &data) : data(&data) {};
|
||||
VectorPointf(Vector<Pointf> *data) : data(data) {};
|
||||
virtual inline double y(int id) {return (*data)[id].y;};
|
||||
virtual inline double x(int id) {return (*data)[id].x;};
|
||||
virtual inline int GetCount() {return data->GetCount();};
|
||||
VectorPointf(const Vector<Pointf> &data) : data(&data) {}
|
||||
VectorPointf(Vector<Pointf> *data) : data(data) {}
|
||||
virtual inline double y(ptrdiff_t id) {return (*data)[int(id)].y;}
|
||||
virtual inline double x(ptrdiff_t id) {return (*data)[int(id)].x;}
|
||||
virtual inline ptrdiff_t GetCount() {return data->GetCount();}
|
||||
};
|
||||
|
||||
class ArrayPointf : public DataSource {
|
||||
|
|
@ -114,10 +115,10 @@ private:
|
|||
Upp::Array<Pointf> *data;
|
||||
|
||||
public:
|
||||
ArrayPointf(Upp::Array<Pointf> &data) : data(&data) {};
|
||||
virtual inline double y(int id) {return (*data)[id].y;};
|
||||
virtual inline double x(int id) {return (*data)[id].x;};
|
||||
virtual inline int GetCount() {return data->GetCount();};
|
||||
ArrayPointf(Upp::Array<Pointf> &data) : data(&data) {}
|
||||
virtual inline double y(ptrdiff_t id) {return (*data)[int(id)].y;}
|
||||
virtual inline double x(ptrdiff_t id) {return (*data)[int(id)].x;}
|
||||
virtual inline ptrdiff_t GetCount() {return data->GetCount();}
|
||||
};
|
||||
|
||||
template <class X, class Y>
|
||||
|
|
@ -126,10 +127,10 @@ private:
|
|||
VectorMap<X, Y> *data;
|
||||
|
||||
public:
|
||||
VectorMapXY(VectorMap<X, Y> &data) : data(&data) {};
|
||||
virtual inline double y(int id) {return (*data)[id];};
|
||||
virtual inline double x(int id) {return (*data).GetKey(id);};
|
||||
virtual inline int GetCount() {return data->GetCount();};
|
||||
VectorMapXY(VectorMap<X, Y> &data) : data(&data) {}
|
||||
virtual inline double y(ptrdiff_t id) {return (*data)[int(id)];}
|
||||
virtual inline double x(ptrdiff_t id) {return (*data).GetKey(int(id));}
|
||||
virtual inline ptrdiff_t GetCount() {return data->GetCount();}
|
||||
};
|
||||
|
||||
template <class X, class Y>
|
||||
|
|
@ -138,21 +139,21 @@ private:
|
|||
ArrayMap<X, Y> *data;
|
||||
|
||||
public:
|
||||
ArrayMapXY(ArrayMap<X, Y> &data) : data(&data) {};
|
||||
virtual inline double y(int id) {return (*data)[id];};
|
||||
virtual inline double x(int id) {return (*data).GetKey(id);};
|
||||
virtual inline int GetCount() {return data->GetCount();};
|
||||
ArrayMapXY(ArrayMap<X, Y> &data) : data(&data) {}
|
||||
virtual inline double y(ptrdiff_t id) {return (*data)[id];}
|
||||
virtual inline double x(ptrdiff_t id) {return (*data).GetKey(id);}
|
||||
virtual inline ptrdiff_t GetCount() {return data->GetCount();}
|
||||
};
|
||||
|
||||
|
||||
class FuncSource : public DataSource {
|
||||
private:
|
||||
double (*function)(double);
|
||||
|
||||
public:
|
||||
FuncSource(double (*function)(double)) : function(function) {};
|
||||
virtual inline double y(int t) {return function(t);};
|
||||
virtual inline double x(int t) {return t;};
|
||||
virtual inline int GetCount() {return Null;};
|
||||
FuncSource(double (*function)(double)) : function(function) {}
|
||||
virtual inline double y(ptrdiff_t t) {return function(double(t));}
|
||||
virtual inline double x(ptrdiff_t t) {return double(t);}
|
||||
virtual inline ptrdiff_t GetCount() {return Null;}
|
||||
};
|
||||
|
||||
class FuncSourcePara : public DataSource {
|
||||
|
|
@ -169,21 +170,21 @@ public:
|
|||
lastT = Null;
|
||||
isParam = true;
|
||||
}
|
||||
virtual inline double y(int t) {
|
||||
virtual inline double y(ptrdiff_t t) {
|
||||
if (IsNull(lastT) || t != lastT) {
|
||||
lastPointf = function(minT + t*(maxT-minT)/numPoints);
|
||||
lastT = t;
|
||||
lastT = double(t);
|
||||
}
|
||||
return lastPointf.y;
|
||||
}
|
||||
virtual inline double x(int t) {
|
||||
virtual inline double x(ptrdiff_t t) {
|
||||
if (IsNull(lastT) || t != lastT) {
|
||||
lastPointf = function(minT + t*(maxT-minT)/numPoints);
|
||||
lastT = t;
|
||||
lastT = double(t);
|
||||
}
|
||||
return lastPointf.x;
|
||||
}
|
||||
virtual inline int GetCount() {return numPoints;};
|
||||
virtual inline ptrdiff_t GetCount() {return numPoints;}
|
||||
};
|
||||
|
||||
typedef Callback2<double&, double> PlotFunc;
|
||||
|
|
@ -194,11 +195,11 @@ private:
|
|||
PlotFunc function;
|
||||
|
||||
public:
|
||||
PlotFuncSource() {};
|
||||
PlotFuncSource(PlotFunc &function) : function(function) {};
|
||||
virtual inline double y(int t) {double y; function(y, t); return y;};
|
||||
virtual inline double x(int t) {return t;};
|
||||
virtual inline int GetCount() {return Null;};
|
||||
PlotFuncSource() {}
|
||||
PlotFuncSource(PlotFunc &function) : function(function) {}
|
||||
virtual inline double y(ptrdiff_t t) {double y; function(y, double(t)); return y;}
|
||||
virtual inline double x(ptrdiff_t t) {return double(t);}
|
||||
virtual inline ptrdiff_t GetCount() {return -1;}
|
||||
};
|
||||
|
||||
class PlotParamFuncSource : public DataSource {
|
||||
|
|
@ -215,22 +216,22 @@ public:
|
|||
lastT = Null;
|
||||
isParam = true;
|
||||
}
|
||||
inline double y(int t) {
|
||||
inline double y(ptrdiff_t t) {
|
||||
if (IsNull(lastT) || t != lastT) {
|
||||
function(lastPointf, minT + t*(maxT-minT)/numPoints);
|
||||
lastT = t;
|
||||
lastT = double(t);
|
||||
}
|
||||
return lastPointf.y;
|
||||
}
|
||||
|
||||
inline double x(int t) {
|
||||
inline double x(ptrdiff_t t) {
|
||||
if (IsNull(lastT) || t != lastT) {
|
||||
function(lastPointf, minT + t*(maxT-minT)/numPoints);
|
||||
lastT = t;
|
||||
lastT = double(t);
|
||||
}
|
||||
return lastPointf.x;
|
||||
}
|
||||
virtual inline int GetCount() {return numPoints;};
|
||||
virtual inline ptrdiff_t GetCount() {return numPoints;}
|
||||
};
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -145,9 +145,9 @@ ScatterDraw& ScatterDraw::ShowLegend(const bool& show)
|
|||
return *this;
|
||||
}
|
||||
|
||||
ScatterDraw& ScatterDraw::SetLegendWeight(const int& weight)
|
||||
ScatterDraw& ScatterDraw::SetLegendWidth(const int& width)
|
||||
{
|
||||
legendWeight = weight;
|
||||
legendWidth = width;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ ScatterDraw &ScatterDraw::SetDrawY2Reticle(bool set)
|
|||
|
||||
void ScatterDraw::DrawLegend(Draw& w, const int& scale) const
|
||||
{
|
||||
int nmr = fround((GetSize().cx - 2*(hPlotLeft + hPlotRight))/legendWeight); //max number of labels per row
|
||||
int nmr = fround((GetSize().cx - 2*(hPlotLeft + hPlotRight))/legendWidth); //max number of labels per row
|
||||
if (nmr <= 0)
|
||||
return;
|
||||
int nLab = series.GetCount(); //number of labels
|
||||
|
|
@ -194,16 +194,16 @@ void ScatterDraw::DrawLegend(Draw& w, const int& scale) const
|
|||
}
|
||||
for(int i = start; i < end; i++) {
|
||||
Vector <Point> vp;
|
||||
vp << Point(scale*(i-start)*legendWeight, scale*(4-12*(j+1))) <<
|
||||
Point(scale*(i-start)*legendWeight+scale*23, scale*(4-12*(j+1)));
|
||||
vp << Point(scale*(i-start)*legendWidth, scale*(4-12*(j+1))) <<
|
||||
Point(scale*(i-start)*legendWidth + scale*23, scale*(4-12*(j+1)));
|
||||
if (series[i].opacity > 0 && series[i].seriesPlot)
|
||||
DrawPolylineOpa(w, vp, scale, 1, scale*series[i].thickness, series[i].color, series[i].dash);
|
||||
Point p(scale*((i-start)*legendWeight+7),scale*(4-12*(j+1))/*+scale*Thick.At(i)/12*/);
|
||||
Point p(scale*((i-start)*legendWidth+7),scale*(4-12*(j+1))/*+scale*Thick.At(i)/12*/);
|
||||
if (series[i].markWidth >= 1 && series[i].markPlot)
|
||||
series[i].markPlot->Paint(w, scale, p, series[i].markWidth, series[i].markColor);
|
||||
Font scaledFont;
|
||||
scaledFont.Height(scale*StdFont().GetHeight());
|
||||
DrawText(w, scale*(i-start)*legendWeight+scale*25, scale*(-2-12*(j+1)), 0,
|
||||
DrawText(w, scale*(i-start)*legendWidth+scale*25, scale*(-2-12*(j+1)), 0,
|
||||
series[i].legend, scaledFont, series[i].color);
|
||||
}
|
||||
}
|
||||
|
|
@ -340,9 +340,13 @@ void ScatterDraw::FitToData(bool vertical) {
|
|||
xMin -= deltaX;
|
||||
xMinUnit += deltaX;
|
||||
AdjustMinUnitX();
|
||||
if (maxx == minx)
|
||||
xRange = 2*maxx;
|
||||
else
|
||||
if (maxx == minx) {
|
||||
if (maxx == 0) {
|
||||
xRange = 2;
|
||||
xMin = -1;
|
||||
} else
|
||||
xRange = 2*maxx;
|
||||
} else
|
||||
xRange = maxx - minx;
|
||||
}
|
||||
if (vertical) {
|
||||
|
|
@ -640,7 +644,7 @@ void ScatterDraw::_InsertSeries(int index, DataSource *data)
|
|||
Refresh();
|
||||
}
|
||||
|
||||
int ScatterDraw::GetCount(int index)
|
||||
ptrdiff_t ScatterDraw::GetCount(int index)
|
||||
{
|
||||
ASSERT(IsValid(index));
|
||||
if (series[index].PointsData()->IsParam())
|
||||
|
|
@ -987,9 +991,9 @@ void ScatterDraw::RemoveAllSeries()
|
|||
|
||||
Drawing ScatterDraw::GetDrawing()
|
||||
{
|
||||
DrawingDraw ddw(6*GetSize());
|
||||
DrawingDraw ddw(3*GetSize());
|
||||
|
||||
SetDrawing (ddw, 6);
|
||||
SetDrawing(ddw, 3);
|
||||
|
||||
return ddw;
|
||||
}
|
||||
|
|
@ -1207,13 +1211,12 @@ ScatterDraw::ScatterDraw()
|
|||
hPlotLeft = hPlotRight = vPlotTop = vPlotBottom = 30;
|
||||
xRange = yRange = yRange2 = 100.0;
|
||||
xMin = yMin = yMin2 = xMinUnit = yMinUnit = yMinUnit2 = 0.0;
|
||||
logX = logY = logY2 = false;
|
||||
gridColor = SColorDkShadow();
|
||||
gridWidth = 1;
|
||||
drawXReticle = true; drawYReticle = true;
|
||||
drawY2Reticle = false;
|
||||
drawVGrid = drawHGrid = showLegend = true;
|
||||
legendWeight = 80;
|
||||
legendWidth = 80;
|
||||
minXZoom = maxXZoom = minYZoom = maxYZoom = -1;
|
||||
fastViewX = false;
|
||||
sequentialXAll = false;
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ public:
|
|||
ScatterDraw& ShowHGrid(const bool& show);
|
||||
|
||||
ScatterDraw& ShowLegend(const bool& show = true);
|
||||
ScatterDraw& SetLegendWeight(const int& weight);
|
||||
ScatterDraw& SetLegendWidth(const int& width);
|
||||
|
||||
ScatterDraw& SetMode(int _mode = MD_ANTIALIASED) {mode = _mode; Refresh(); return *this;};
|
||||
int GetMode() {return mode;};
|
||||
|
|
@ -248,7 +248,7 @@ public:
|
|||
template <class X, class Y>
|
||||
void InsertSeries(int index, ArrayMap<X, Y> &data) {_InsertSeries(index, new ArrayMapXY<X, Y>(data));}
|
||||
|
||||
int GetCount(int index);
|
||||
ptrdiff_t GetCount(int index);
|
||||
void GetValues(int index, int idata, double &x, double &y);
|
||||
double GetValueX(int index, int idata);
|
||||
double GetValueY(int index, int idata);
|
||||
|
|
@ -342,10 +342,6 @@ public:
|
|||
void SaveAsMetafile(const char* file) const;
|
||||
#endif
|
||||
|
||||
ScatterDraw& LogX(const bool& logx=true) {logX=logx; return *this;}
|
||||
ScatterDraw& LogY(const bool& logy=true) {logY=logy; return *this;}
|
||||
ScatterDraw& LogY2(const bool& logy=true) {logY2=logy; return *this;}
|
||||
|
||||
ScatterDraw& SetMinZoom(double x, double y = -1) {minXZoom = x; minYZoom = y; return *this;}
|
||||
ScatterDraw& SetMaxZoom(double x, double y = -1) {maxXZoom = x; maxYZoom = y; return *this;}
|
||||
|
||||
|
|
@ -370,6 +366,7 @@ protected:
|
|||
String title;
|
||||
Font titleFont;
|
||||
Color titleColor;
|
||||
int titleHeight;
|
||||
|
||||
String xLabel, yLabel, yLabel2;
|
||||
Font labelsFont;
|
||||
|
|
@ -404,7 +401,7 @@ protected:
|
|||
Vector<ScatterSeries> series;
|
||||
|
||||
bool showLegend;
|
||||
int legendWeight;
|
||||
int legendWidth;
|
||||
|
||||
void DrawLegend(Draw& w,const int& scale) const;
|
||||
|
||||
|
|
@ -440,8 +437,6 @@ protected:
|
|||
void AdjustMinUnitY();
|
||||
void AdjustMinUnitY2();
|
||||
|
||||
bool logX, logY, logY2;
|
||||
|
||||
private:
|
||||
Size size;
|
||||
static void ParseTextMultiline(const String &text, Font fnt,
|
||||
|
|
@ -463,7 +458,7 @@ void ScatterDraw::SetDrawing(T& w, const int& scale)
|
|||
|
||||
Size sz(0, 0);
|
||||
|
||||
int titleHeight = !title.IsEmpty() ? scale*titleFont.GetHeight() : 0;
|
||||
titleHeight = !title.IsEmpty() ? scale*titleFont.GetHeight() : 0;
|
||||
|
||||
if(titleHeight > 0) {
|
||||
Font fontTitle6;
|
||||
|
|
@ -562,6 +557,8 @@ void ScatterDraw::SetDrawing(T& w, const int& scale)
|
|||
ClipEnd(w);
|
||||
}
|
||||
|
||||
void kk();
|
||||
|
||||
template <class T>
|
||||
void ScatterDraw::Plot(T& w, const int& scale, const int& plotW, const int& plotH)
|
||||
{
|
||||
|
|
@ -592,7 +589,7 @@ void ScatterDraw::Plot(T& w, const int& scale, const int& plotW, const int& plot
|
|||
if (series[j].opacity == 0 || (!series[j].seriesPlot && !series[j].markPlot))
|
||||
continue;
|
||||
Vector<Point> p1;
|
||||
int imin, imax;
|
||||
ptrdiff_t imin, imax;
|
||||
if (series[j].sequential) {
|
||||
imin = imax = Null;
|
||||
for (int i = 1; i < series[j].PointsData()->GetCount() - 1; ++i) {
|
||||
|
|
@ -611,19 +608,19 @@ void ScatterDraw::Plot(T& w, const int& scale, const int& plotW, const int& plot
|
|||
} else if (series[j].PointsData()->IsParam()) { // It is a param function
|
||||
imin = 0;
|
||||
imax = series[j].PointsData()->GetCount();
|
||||
} else if (IsNull(series[j].PointsData()->GetCount())) { // It is a function
|
||||
} else if (IsNull(series[j].PointsData()->GetCount())) { // It is a function
|
||||
imin = fround(xMin) - 1;
|
||||
imax = fround(xMin + xRange) + 1;
|
||||
} else {
|
||||
imin = 0;
|
||||
imax = series[j].PointsData()->GetCount();
|
||||
}
|
||||
int numV;
|
||||
ptrdiff_t numV;
|
||||
if (fastViewX)
|
||||
numV = 1 + (imax - imin)/plotW;
|
||||
else
|
||||
numV = 1;
|
||||
for (int i = imin; i < imax; i += numV) {
|
||||
for (ptrdiff_t i = imin; i < imax; i += numV) {
|
||||
double xx, yy;
|
||||
if (fastViewX && numV > 1) {
|
||||
yy = 0;
|
||||
|
|
@ -634,10 +631,12 @@ void ScatterDraw::Plot(T& w, const int& scale, const int& plotW, const int& plot
|
|||
xx = (series[j].PointsData()->x(i) + series[j].PointsData()->x(i + ii - 1))/2;
|
||||
} else {
|
||||
xx = series[j].PointsData()->x(i);
|
||||
DUMP(i);
|
||||
DUMP(series[j].PointsData()->x(i));
|
||||
yy = series[j].PointsData()->y(i);
|
||||
}
|
||||
int ix, iy;
|
||||
ix = fround(plotW*(xx - xMin)/xRange);
|
||||
int ix = fround(plotW*(xx - xMin)/xRange);
|
||||
int iy;
|
||||
if (series[j].primaryY)
|
||||
iy = fround(plotH*(yy - yMin)/yRange);
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue