QPainterPath path;
path.moveTo((width()/2)-100*scale, (height()/2)-chart->func(-100)*scale);
float y = 0;
for(float x = -100; x <= 100; x+=0.001) {
y = chart->func(x);
path.lineTo(((width()/2)+x *scale), ((height()/2)-y*scale));
}
path.closeSubpath();
painter.drawPath(path);