<commit_before>$(function() {
  var purchaseCount = $('#placeholder').data().purchaseCount;

  var cumRoyalties = $('#placeholder').data().cumRoyalties;

  var goalData = $('#placeholder').data().goalData;

  function yenFormatter(v, axis) {
    return '$' + v.toFixed(axis.tickDecimals);
  }

  function countFormatter(v, axis) {
    return v.toFixed(axis.tickDecimals) + '冊';
  }

  function toDate(sec) {
    var d = new Date();
    d.setTime(sec);
    return d;
  }

  function dateFormat(date) {
    var y = date.getFullYear();
    var m = date.getMonth() + 1;
    var d = date.getDate();

    if (m < 10) {
      m = '0' + m;
    }
    if (d < 10) {
      d = '0' + d;
    }

    return y + '/' + m + '/' + d;
  }

  var data = [{
    label: '購入数',
    data: purchaseCount,
    bars: {show: true, barWidth: 20000000, align: 'center'},
    yaxis: 2
  }, {
    label: '累計額',
    data: cumRoyalties,
    lines: {show: true, lineWidth: 5},
    points: {show: true}
  }, {
    label: '目標額',
    data: goalData,
    lines: {show: true}
  }];

  var options = {
    xaxes: [ { mode: 'time' } ],
    yaxes: [ {
      alignTicksWithAxis: 1,
      position: 'right',
      tickFormatter: yenFormatter
    }, { min: 0, tickFormatter: countFormatter } ],
    legend: { position: "ne" },
    colors: ["#eb941f", "#55a868", "#c60c30"],
    grid: {
      hoverable: true
    }
  };

  $.plot("#placeholder", data, options);

  $("<div id='tooltip'></div>").css({
    position: "absolute",
    display: "none",
    border: "1px solid #fdd",
    padding: "2px",
    "background-color": "#fee",
    opacity: 0.80
  }).appendTo("body");

  $("#placeholder").bind("plothover", function (event, pos, item) {
    if (item) {
      var x = item.datapoint[0].toFixed(0);

      var text = null;
      if (item.seriesIndex == 0) {
        var y = item.datapoint[1].toFixed(0);
        text = dateFormat(toDate(x)) + " : " + y + "冊";
      } else if (item.seriesIndex == 1) {
        var y = item.datapoint[1].toFixed(2);
        text = dateFormat(toDate(x)) + " : $" + y;
      }
      if (text) {
        $("#tooltip").html(text)
          .css({top: item.pageY+5, left: item.pageX+5})
          .fadeIn(200);
      }
    } else {
      $("#tooltip").hide();
    }
  });
});<commit_msg>Remove date from goal tooltip<commit_after>$(function() {
  var purchaseCount = $('#placeholder').data().purchaseCount;

  var cumRoyalties = $('#placeholder').data().cumRoyalties;

  var goalData = $('#placeholder').data().goalData;

  function yenFormatter(v, axis) {
    return '$' + v.toFixed(axis.tickDecimals);
  }

  function countFormatter(v, axis) {
    return v.toFixed(axis.tickDecimals) + '冊';
  }

  function toDate(sec) {
    var d = new Date();
    d.setTime(sec);
    return d;
  }

  function dateFormat(date) {
    var y = date.getFullYear();
    var m = date.getMonth() + 1;
    var d = date.getDate();

    if (m < 10) {
      m = '0' + m;
    }
    if (d < 10) {
      d = '0' + d;
    }

    return y + '/' + m + '/' + d;
  }

  var data = [{
    label: '購入数',
    data: purchaseCount,
    bars: {show: true, barWidth: 20000000, align: 'center'},
    yaxis: 2
  }, {
    label: '累計額',
    data: cumRoyalties,
    lines: {show: true, lineWidth: 5},
    points: {show: true}
  }, {
    label: '目標額',
    data: goalData,
    lines: {show: true}
  }];

  var options = {
    xaxes: [ { mode: 'time' } ],
    yaxes: [ {
      alignTicksWithAxis: 1,
      position: 'right',
      tickFormatter: yenFormatter
    }, { min: 0, tickFormatter: countFormatter } ],
    legend: { position: "ne" },
    colors: ["#eb941f", "#55a868", "#c60c30"],
    grid: {
      hoverable: true
    }
  };

  $.plot("#placeholder", data, options);

  $("<div id='tooltip'></div>").css({
    position: "absolute",
    display: "none",
    border: "1px solid #fdd",
    padding: "2px",
    "background-color": "#fee",
    opacity: 0.80
  }).appendTo("body");

  $("#placeholder").bind("plothover", function (event, pos, item) {
    if (item) {
      var x = item.datapoint[0].toFixed(0);

      var text = null;
      if (item.seriesIndex == 0) {
        var y = item.datapoint[1].toFixed(0);
        text = dateFormat(toDate(x)) + " : " + y + "冊";
      } else if (item.seriesIndex == 1) {
        var y = item.datapoint[1].toFixed(2);
        text = dateFormat(toDate(x)) + " : $" + y;
      } else if (item.seriesIndex == 2) {
        var y = item.datapoint[1].toFixed(2);
        text = "$" + y;
      }
      if (text) {
        $("#tooltip").html(text)
          .css({top: item.pageY+5, left: item.pageX+5})
          .fadeIn(200);
      }
    } else {
      $("#tooltip").hide();
    }
  });
});
{'fraction_non_alphanumeric': 0.19489708404802744, 'fraction_numerical': 0.021655231560891938, 'mean_word_length': 2.360951008645533, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '947574', 'n_tokens_mistral': 1796, 'n_tokens_neox': 1702, 'n_words': 375}