Source code
Chart Features
This is an Area Chart that contains a Legend Widget to compare company performance againt a market index.
-
legend.boxAncho=sw: The Legend is anchored south, so adding more swatch boxes means the legend will grow up and no need to re-adjust the chart.
-
chart.lines[0].inFills=True: Makes it an area rather than a line
Two rectangles are added to color in the bottom and left sides of the chart:
- self._add(self,Rect(0,0,self.width,self.height,fillColor=self._colors[5],strokeColor=None),name='bgrect0',validate=None,desc=None)
- self._add(self,Rect(0,0,self.width,self.height,fillColor=self._colors[5],strokeColor=None),name='bgrect1',validate=None,desc=None)
- self.bgrect0.width = self.chart.x
- self.bgrect0.height = self.height
- self.bgrect1.x = self.chart.x
- self.bgrect1.width = self.chart.width
-
self.bgrect1.height = self.chart.y
-
The X Axis is a date axis and can choose a suitable range of dates depending on your preferences, there are dozens of attributes that allow all possibilities if you navigate to chart.xValueAxis you see properties such as:
- forceDatesEachYear
- forceEndDate
- forceFirstDate
- forceZero
- niceMonth
-
chart.xValueAxis.labels.angle=45: Angles the X Axis labels 45 degrees