3 comments on “iTunes Missing Feature – Library Statistics

  1. istat is genius but it’s possible to have TOP 20 artists ? (sorry for my english)

    • Thanks! And sure it can be done. Edit each function that builds the charts such that the loop is incremented to 20 or 5 or whatever you want. The functions building the charts are all named similar: StatBldCht*

      Note the highlighted line below where you would change the max from 10 to whatever:


      // Create top 10 Tracks chart
      function StatBldChtTopTrk() {
      var eChart = document.getElementById('cChartTopTrk');
      var aTopNames = [], aTopPlays = [], iLp = 0;

      // Sort artists by play count
      aTracks.sort(function(a, b){ return b.fPlay - a.fPlay });

      // Grab top 10
      for (iLp = 0; iLp < 10; iLp ++) {

      I built this with 10 in mind as thats what I was after. Increasing beyond ten may cause the graph colors to break, or appear the same beyond 10 because the code is written with an array of 10 colors. You could expand them, or alter them if you dont like the rainbow effect, by modifying the arrays. For 20, you would need 10 more array entries for both backgroundColor and borderColor. Again in each StatBldCht* function, look for this part of the code and modify:

      backgroundColor: [
      'rgba(227, 28, 28, 0.7)',
      'rgba(235, 103, 25, 0.7)',
      'rgba(246, 161, 16, 0.7)',
      'rgba(246, 215, 1, 0.7)',
      'rgba(154, 194, 30, 0.7)',
      'rgba(0, 139, 89, 0.7)',
      'rgba(12, 138, 182, 0.7)',
      'rgba(51, 92, 163, 0.7)',
      'rgba(87, 60, 142, 0.7)',
      'rgba(181, 14, 144, 0.7)'
      ],
      borderColor: [
      'rgb(227, 28, 28)',
      'rgb(235, 103, 25)',
      'rgb(246, 161, 16)',
      'rgb(246, 215, 1)',
      'rgb(154, 194, 30)',
      'rgb(0, 139, 89)',
      'rgb(12, 138, 182)',
      'rgb(51, 92, 163)',
      'rgb(87, 60, 142)',
      'rgb(181, 14, 144)'
      ],

      Then you would want to change the text of the chart match the number of entries. Simply modify the line in each StatBldCht* function (bold here):

      options: {
      legend: { display: false },
      title: { text: 'Top 10 Tracks (by Plays)' },

      I know a lot of this code could be shared across functions making it quicker to modify. I didn’t want to put a ton of effort into the project. Note that I’ve also read that the XML file output will likely be deprecated by Apple in the future, making this useless. Very disappointing.

Leave a Reply to Itunesian Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.