Chart not showing properly? iOS Charts libraryJavaScript Chart LibraryIs there a good charting library for iPhone?BIRT, repeating chart in listiOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 BetaXcode 6: Keyboard does not show up in simulatordyld: Library not loaded: @rpath/libswiftCore.dylibCan I both scroll the chart and drag the indicator in ios-charts ? I am using ios-charts libraryiOS Charts - Grouped Bar chart not index properlyissues with iOS Chart libraryAdding Custom marker in bar charts using iOS Charts Library

How do you make your own symbol when Detexify fails?

How much theory knowledge is actually used while playing?

Quoting Keynes in a lecture

Is there a RAID 0 Equivalent for RAM?

How can ping know if my host is down

Which was the first story featuring espers?

Non-trope happy ending?

What is the highest possible scrabble score for placing a single tile

How many arrows is an archer expected to fire by the end of the Tyranny of Dragons pair of adventures?

How to convince somebody that he is fit for something else, but not this job?

Delete multiple columns using awk or sed

Microchip documentation does not label CAN buss pins on micro controller pinout diagram

How can I write humor as character trait?

What features enable the Su-25 Frogfoot to operate with such a wide variety of fuels?

What does Apple's new App Store requirement mean

A Trivial Diagnosis

Were Persian-Median kings illiterate?

What kind of floor tile is this?

What does "Scientists rise up against statistical significance" mean? (Comment in Nature)

How to get directions in deep space?

Why do ¬, ∀ and ∃ have the same precedence?

What fields between the rationals and the reals allow a good notion of 2D distance?

Do we have to expect a queue for the shuttle from Watford Junction to Harry Potter Studio?

Are Captain Marvel's powers affected by Thanos breaking the Tesseract and claiming the stone?



Chart not showing properly? iOS Charts library


JavaScript Chart LibraryIs there a good charting library for iPhone?BIRT, repeating chart in listiOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 BetaXcode 6: Keyboard does not show up in simulatordyld: Library not loaded: @rpath/libswiftCore.dylibCan I both scroll the chart and drag the indicator in ios-charts ? I am using ios-charts libraryiOS Charts - Grouped Bar chart not index properlyissues with iOS Chart libraryAdding Custom marker in bar charts using iOS Charts Library













0















I'm using charts library for creating graph like this



enter image description here



I'm using this code to populate the chart.
The data that is sent in the below code is




[[1.6667000000000001, 2.0], [1.6667000000000001, 1.0], [1.6667000000000001, 1.0], [2.3333000000000004, 2.0], [1.3332999999999999, 1.0], [1.6667000000000001, 3.0], [1.3332999999999999, 2.0], [1.3332999999999999, 1.0], [2.3333000000000004, 3.0], [2.0, 2.0], [2.6666999999999996, 3.0], [2.3333000000000004, 1.0], [2.3333000000000004, 2.0]]




func setChart(data:[[Double]]) 
barChartView.noDataText = "You need to provide data for the chart."
var dataEntries: [[BarChartDataEntry]] = []

for _ in 0..<data.first!.count
dataEntries.append([])


for i in 0..<data.count

for g in 0..<dataEntries.count
dataEntries[g].append(BarChartDataEntry(x: Double(i), y: data[i][g]))




var dataSet = [BarChartDataSet]()

for i in 0..<dataEntries.count

let some = BarChartDataSet(values: dataEntries[i], label: nil)
some.colors = ChartColorTemplates.colorful()
dataSet.append(some)





let chartData = BarChartData(dataSets: dataSet)


let groupSpace = 0.025
let barSpace = 0.4
let barWidth = 0.8
// (0.05 + 0.03) * 3 + 0.3 = 1.00 -> interval per "group"
//(groupSpace * barSpace) * n + groupSpace = 1
//()*13
let startYear = 0


chartData.barWidth = barWidth;
barChartView.xAxis.axisMinimum = Double(startYear)
let gg = chartData.groupWidth(groupSpace: groupSpace, barSpace: barSpace)
print("Groupspace: (gg)")
// barChartView.xAxis.axisMaximum = Double(startYear) + gg * Double(groupCount)
barChartView.xAxis.axisMaximum = 25
barChartView.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace)
//chartData.groupWidth(groupSpace: groupSpace, barSpace: barSpace)
barChartView.notifyDataSetChanged()

barChartView.data = chartData






//background color
barChartView.backgroundColor = UIColor(red: 189/255, green: 195/255, blue: 199/255, alpha: 1)

//chart animation
barChartView.animate(xAxisDuration: 1.5, yAxisDuration: 1.5, easingOption: .linear)



This is not working correctly I'm having overlapped bars. the X-Axis maximum is not creating automatically. I don't know what I am doing wrong here. Anyone can please tell me where I'm wrong.
The number of bars per group is 13 and the number of groups can vary till 50.










share|improve this question




























    0















    I'm using charts library for creating graph like this



    enter image description here



    I'm using this code to populate the chart.
    The data that is sent in the below code is




    [[1.6667000000000001, 2.0], [1.6667000000000001, 1.0], [1.6667000000000001, 1.0], [2.3333000000000004, 2.0], [1.3332999999999999, 1.0], [1.6667000000000001, 3.0], [1.3332999999999999, 2.0], [1.3332999999999999, 1.0], [2.3333000000000004, 3.0], [2.0, 2.0], [2.6666999999999996, 3.0], [2.3333000000000004, 1.0], [2.3333000000000004, 2.0]]




    func setChart(data:[[Double]]) 
    barChartView.noDataText = "You need to provide data for the chart."
    var dataEntries: [[BarChartDataEntry]] = []

    for _ in 0..<data.first!.count
    dataEntries.append([])


    for i in 0..<data.count

    for g in 0..<dataEntries.count
    dataEntries[g].append(BarChartDataEntry(x: Double(i), y: data[i][g]))




    var dataSet = [BarChartDataSet]()

    for i in 0..<dataEntries.count

    let some = BarChartDataSet(values: dataEntries[i], label: nil)
    some.colors = ChartColorTemplates.colorful()
    dataSet.append(some)





    let chartData = BarChartData(dataSets: dataSet)


    let groupSpace = 0.025
    let barSpace = 0.4
    let barWidth = 0.8
    // (0.05 + 0.03) * 3 + 0.3 = 1.00 -> interval per "group"
    //(groupSpace * barSpace) * n + groupSpace = 1
    //()*13
    let startYear = 0


    chartData.barWidth = barWidth;
    barChartView.xAxis.axisMinimum = Double(startYear)
    let gg = chartData.groupWidth(groupSpace: groupSpace, barSpace: barSpace)
    print("Groupspace: (gg)")
    // barChartView.xAxis.axisMaximum = Double(startYear) + gg * Double(groupCount)
    barChartView.xAxis.axisMaximum = 25
    barChartView.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace)
    //chartData.groupWidth(groupSpace: groupSpace, barSpace: barSpace)
    barChartView.notifyDataSetChanged()

    barChartView.data = chartData






    //background color
    barChartView.backgroundColor = UIColor(red: 189/255, green: 195/255, blue: 199/255, alpha: 1)

    //chart animation
    barChartView.animate(xAxisDuration: 1.5, yAxisDuration: 1.5, easingOption: .linear)



    This is not working correctly I'm having overlapped bars. the X-Axis maximum is not creating automatically. I don't know what I am doing wrong here. Anyone can please tell me where I'm wrong.
    The number of bars per group is 13 and the number of groups can vary till 50.










    share|improve this question


























      0












      0








      0








      I'm using charts library for creating graph like this



      enter image description here



      I'm using this code to populate the chart.
      The data that is sent in the below code is




      [[1.6667000000000001, 2.0], [1.6667000000000001, 1.0], [1.6667000000000001, 1.0], [2.3333000000000004, 2.0], [1.3332999999999999, 1.0], [1.6667000000000001, 3.0], [1.3332999999999999, 2.0], [1.3332999999999999, 1.0], [2.3333000000000004, 3.0], [2.0, 2.0], [2.6666999999999996, 3.0], [2.3333000000000004, 1.0], [2.3333000000000004, 2.0]]




      func setChart(data:[[Double]]) 
      barChartView.noDataText = "You need to provide data for the chart."
      var dataEntries: [[BarChartDataEntry]] = []

      for _ in 0..<data.first!.count
      dataEntries.append([])


      for i in 0..<data.count

      for g in 0..<dataEntries.count
      dataEntries[g].append(BarChartDataEntry(x: Double(i), y: data[i][g]))




      var dataSet = [BarChartDataSet]()

      for i in 0..<dataEntries.count

      let some = BarChartDataSet(values: dataEntries[i], label: nil)
      some.colors = ChartColorTemplates.colorful()
      dataSet.append(some)





      let chartData = BarChartData(dataSets: dataSet)


      let groupSpace = 0.025
      let barSpace = 0.4
      let barWidth = 0.8
      // (0.05 + 0.03) * 3 + 0.3 = 1.00 -> interval per "group"
      //(groupSpace * barSpace) * n + groupSpace = 1
      //()*13
      let startYear = 0


      chartData.barWidth = barWidth;
      barChartView.xAxis.axisMinimum = Double(startYear)
      let gg = chartData.groupWidth(groupSpace: groupSpace, barSpace: barSpace)
      print("Groupspace: (gg)")
      // barChartView.xAxis.axisMaximum = Double(startYear) + gg * Double(groupCount)
      barChartView.xAxis.axisMaximum = 25
      barChartView.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace)
      //chartData.groupWidth(groupSpace: groupSpace, barSpace: barSpace)
      barChartView.notifyDataSetChanged()

      barChartView.data = chartData






      //background color
      barChartView.backgroundColor = UIColor(red: 189/255, green: 195/255, blue: 199/255, alpha: 1)

      //chart animation
      barChartView.animate(xAxisDuration: 1.5, yAxisDuration: 1.5, easingOption: .linear)



      This is not working correctly I'm having overlapped bars. the X-Axis maximum is not creating automatically. I don't know what I am doing wrong here. Anyone can please tell me where I'm wrong.
      The number of bars per group is 13 and the number of groups can vary till 50.










      share|improve this question
















      I'm using charts library for creating graph like this



      enter image description here



      I'm using this code to populate the chart.
      The data that is sent in the below code is




      [[1.6667000000000001, 2.0], [1.6667000000000001, 1.0], [1.6667000000000001, 1.0], [2.3333000000000004, 2.0], [1.3332999999999999, 1.0], [1.6667000000000001, 3.0], [1.3332999999999999, 2.0], [1.3332999999999999, 1.0], [2.3333000000000004, 3.0], [2.0, 2.0], [2.6666999999999996, 3.0], [2.3333000000000004, 1.0], [2.3333000000000004, 2.0]]




      func setChart(data:[[Double]]) 
      barChartView.noDataText = "You need to provide data for the chart."
      var dataEntries: [[BarChartDataEntry]] = []

      for _ in 0..<data.first!.count
      dataEntries.append([])


      for i in 0..<data.count

      for g in 0..<dataEntries.count
      dataEntries[g].append(BarChartDataEntry(x: Double(i), y: data[i][g]))




      var dataSet = [BarChartDataSet]()

      for i in 0..<dataEntries.count

      let some = BarChartDataSet(values: dataEntries[i], label: nil)
      some.colors = ChartColorTemplates.colorful()
      dataSet.append(some)





      let chartData = BarChartData(dataSets: dataSet)


      let groupSpace = 0.025
      let barSpace = 0.4
      let barWidth = 0.8
      // (0.05 + 0.03) * 3 + 0.3 = 1.00 -> interval per "group"
      //(groupSpace * barSpace) * n + groupSpace = 1
      //()*13
      let startYear = 0


      chartData.barWidth = barWidth;
      barChartView.xAxis.axisMinimum = Double(startYear)
      let gg = chartData.groupWidth(groupSpace: groupSpace, barSpace: barSpace)
      print("Groupspace: (gg)")
      // barChartView.xAxis.axisMaximum = Double(startYear) + gg * Double(groupCount)
      barChartView.xAxis.axisMaximum = 25
      barChartView.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace)
      //chartData.groupWidth(groupSpace: groupSpace, barSpace: barSpace)
      barChartView.notifyDataSetChanged()

      barChartView.data = chartData






      //background color
      barChartView.backgroundColor = UIColor(red: 189/255, green: 195/255, blue: 199/255, alpha: 1)

      //chart animation
      barChartView.animate(xAxisDuration: 1.5, yAxisDuration: 1.5, easingOption: .linear)



      This is not working correctly I'm having overlapped bars. the X-Axis maximum is not creating automatically. I don't know what I am doing wrong here. Anyone can please tell me where I'm wrong.
      The number of bars per group is 13 and the number of groups can vary till 50.







      ios swift charts ios-charts






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 7 at 5:07









      DevB2F

      1,92821332




      1,92821332










      asked Sep 7 '17 at 14:38









      Arun KArun K

      393421




      393421






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Its very simple and you are setting groupBars for barChartView. Its wrong.



          barChartView.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace)


          You have to set groupBars for chartData. Like below



          chartData.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace)





          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f46099142%2fchart-not-showing-properly-ios-charts-library%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Its very simple and you are setting groupBars for barChartView. Its wrong.



            barChartView.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace)


            You have to set groupBars for chartData. Like below



            chartData.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace)





            share|improve this answer



























              0














              Its very simple and you are setting groupBars for barChartView. Its wrong.



              barChartView.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace)


              You have to set groupBars for chartData. Like below



              chartData.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace)





              share|improve this answer

























                0












                0








                0







                Its very simple and you are setting groupBars for barChartView. Its wrong.



                barChartView.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace)


                You have to set groupBars for chartData. Like below



                chartData.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace)





                share|improve this answer













                Its very simple and you are setting groupBars for barChartView. Its wrong.



                barChartView.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace)


                You have to set groupBars for chartData. Like below



                chartData.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace)






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Sep 11 '17 at 22:55









                Vini AppVini App

                5,05821337




                5,05821337





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f46099142%2fchart-not-showing-properly-ios-charts-library%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    1928 у кіно

                    Захаров Федір Захарович

                    Ель Греко