title: How does one define , extract and replace data from a Chart in an existing Powerpoint using Python
body: <p>Currently I am using the following code to define and replace 
  Placeholder (Text data) in existing Powerpoint presentations. </p>
  
  <pre><code>current_dir = os.path.dirname(os.path.realpath(__file__))
  
  prs = Presentation(current_dir + '/test2.pptx')
  
  slides = prs.slides
  
  title_slide_layout = prs.slide_layouts[0]
  slide = slides[0]
  for shape in slide.placeholders:
      print('%d %s' % (shape.placeholder_format.idx, shape.name))
  title = slide.shapes.title
  subtitle1 = slide.shapes.placeholders[0]
  subtitle2 = slide.shapes.placeholders[10]
  subtitle10 = slide.shapes.placeholders[11]
  subtitle11 = slide.shapes.placeholders[12]
  
  subtitle1.text = "1"
  subtitle2.text = "2"
  subtitle10.text = "3"
  subtitle11.text = "4"
  
  
  slide2 = slides[1]
  for shape in slide2.placeholders:
      print('%d %s' % (shape.placeholder_format.idx, shape.name))
  subtitle3 = slide2.shapes.placeholders[10]
  subtitle4 = slide2.shapes.placeholders[11]
  subtitle5 = slide2.shapes.placeholders[12]
  subtitle6 = slide2.shapes.placeholders[13]
  subtitle12 = slide2.shapes.placeholders[16]
  companydate = slide2.shapes.placeholders[14]
  
  subtitle3.text = "1"
  subtitle4.text = "2"
  subtitle5.text = "3"
  subtitle6.text = "4"
  subtitle12.text = "40%"
  companydate.text = "Insert company"
  
  slide3 = slides[2]
  for shape in slide3.placeholders:
       print('%d %s' % (shape.placeholder_format.idx, shape.name))
  subtitle7 = slide3.shapes.placeholders[10]
  subtitle8 = slide3.shapes.placeholders[11]
  subtitle9 = slide3.shapes.placeholders[12]
  subtitle13 = slide3.shapes.placeholders[16]
  companydate2 = slide3.shapes.placeholders[14]
  
  subtitle7.text = "1"
  subtitle8.text = "2"
  subtitle9.text = "3"
  subtitle13.text = "5x"
  companydate2.text = "Insert Company"
  
  slide4 = slides[3]
  # for shape in slide4.placeholders:
  #print('%d %s' % (shape.placeholder_format.idx, shape.name))
  companydate3 = slide4.shapes.placeholders[14]
  companydate3.text = "Insert Company"
  
  "'Adapting Charts'"
  from pptx.chart.data import ChartData
  from pptx.enum.chart import XL_CHART_TYPE
  from pptx.util import Pt
  
  "Adapting Chart 1"
  
  prs1 = Presentation(current_dir + '/output4.pptx')
  slides1 = prs1.slides
  
  chart1 = prs1.slides[0].chart
  </code></pre>
  
  <p>However, I am also running analytics in the background and I was wondering if it is possible to recognize (define) charts in the same presentation along with extracting and replacing the data in those charts. These chards are not embedded in the template. 
  As plotting charts with plotly or mathplotlib does not render a compliant image I am not able to use these , unless fully modified into the following format:<a href="https://i.stack.imgur.com/5c54h.png" rel="nofollow noreferrer">Graph budget Click Correl</a>
  If yes, would it be possible to give concrete coding examples? </p>
  
  <p>Thanks in advance!</p>