Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. c1 = LineChart()
  2. c1.title = "SLA Discharge - 5.5A: V_BAT"
  3. c1.style = 12
  4. c1.y_axis.crossAx = 500
  5. c1.x_axis = DateAxis(crossAx=100)
  6. c1.x_axis.number_format = 'd-HH-MM-SS'
  7. c1.x_axis.majorTimeUnit = "days"
  8. c1.y_axis.title = "Battery Voltage"
  9. c1.x_axis.title = "Time"
  10. data = Reference(ws2, min_col=2, min_row=1, max_col=2, max_row=sheet.max_row)
  11. c1.add_data(data, titles_from_data=True)
  12. dates = Reference(ws2, min_col=1, min_row=2, max_row=sheet.max_row)
  13. c1.set_categories(dates)
  14.  
  15. c2 = LineChart()
  16. data2 = Reference(ws2, min_col=3, min_row=1, max_col=3)
  17. c2.add_data(data2, titles_from_data=True, from_rows=True)
  18.  
  19. c2.y_axis.axId = 200
  20. c2.y_axis.title = "Qbat Percentage"
  21. c1.y_axis.crosses = "max"
  22. c1 += c2
  23.  
  24.  
  25. s1 = c1.series[0]
  26. s1.graphicalProperties.line.solidFill = "BE4B48"
  27. s1.graphicalProperties.line.width = 25000 # width in EMUs.
  28. s1.smooth = True # Make the line smooth
  29. ws2.add_chart(c1, "D5")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement