title: core-plot swift version of barFillForPlotColor
body: <p>Good day to all of you;</p>
  
  <p>I have recently started working with CorePlot in my iOS projects and have learned how to create bar charts from my data (thank you RayWenderlich tutorial).</p>
  
  <p>Now, rather than using one colour for all the bars I would like to colour them based on their values.  For example, values below 1.0 are red, values of 1.0 are blue, and values above 1.0 are green.</p>
  
  <p>I know this can be done and I have read numerous articles that talk about using the <strong>-(nullable CPTFill *)barFillForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndex:(NSUInteger)index</strong> function.  In fact I have looked at the coloredBarChart example in the <em>CorePlot Examples - Plot Gallery</em> and see how they are using this function.  The problem I am having is that I am programming in Swift and need to have a Swift version of this function that I can use, or an explanation of how I can use this version in my Swift code.</p>
  
  <p>Any assistance that you can provide is greatly appreciated.</p>