In y-axis-1 my data is like this : 160000, but I want to display it as 1,60,000
In y-axis-2 my data is like this: 9400000, but I want to display it as
₹94,00,000
I don't want chart legend
At the same time, when the line and bar chart interfere at a place, I want display the data with comma and INR symbols same as mentioned above.
<script type="text/javascript" src="https://rawgit.com/nnnick/Chart.js/v1.0.2/Chart.min.js"></script>
<script type="text/javascript" src="https://rawgit.com/jtblin/angular-chart.js/0.8.0/dist/angular-chart.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/jtblin/angular-chart.js/0.8.0/dist/angular-chart.css" />
<canvas id="base" class="chart-bar" chart-data="data" chart-labels="labels" width="281%" chart-colors="colors" chart-options="options" chart-dataset-override="datasetOverride" style="margin-top:12%"></canvas>
//Mixed chart
$scope.months = null;
$http.get(apiUrl + "/api/Warehouse/GetMonthDetails")
.then(function (response) {
$scope.months = JSON.parse(response.data);
$scope.options = {
//multiTooltipTemplate: function (label) {
// return label.datasetLabel + ': ' + label.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
//},
title: {
display: true,
text: 'Quantity v/s Value(in months)',
fontSize: 18,
position: 'bottom'
},
scales: {
yAxes: [
{
id: 'y-axis-1',
type: 'linear',
display: true,
position: 'left'
},
{
id: 'y-axis-2',
type: 'linear',
display: true,
position: 'right'
}
]
},
type: 'horizontalBar'
}
$scope.colors = ['#00ADF9', '#949FB1'];
$scope.labels = [];
var qty = [];
var value = [];
for (var i = 0; i < $scope.months.length; i++) {
if ($scope.months[i].Qty != 0 && $scope.months[i].Value != 0) {
$scope.labels.push($scope.months[i].MonthName);
qty.push($scope.months[i].Qty);
value.push($scope.months[i].Value);
}
}
$scope.data = [qty, value];
$scope.datasetOverride = [
{
label: "Quantity",
borderWidth: 1,
type: 'bar',
yAxisID: 'y-axis-1'
},
{
label: "Value",
borderWidth: 3,
hoverBackgroundColor: "rgba(255,99,132,0.4)",
hoverBorderColor: "rgba(255,99,132,1)",
type: 'line',
yAxisID: 'y-axis-2'
}
];
})
[HttpGet]
[ActionName("GetMonthDetails")]
public string GetMonthWise()
{
SqlConnection myConnection = new SqlConnection();
myConnection.ConnectionString = ConfigurationManager.ConnectionStrings["ERPConnectionStringL"].ConnectionString;
SqlCommand sqlCmd = new SqlCommand();
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "REPORT_WH_DASHBOARD";
sqlCmd.Connection = myConnection;
SqlDataAdapter sda = new SqlDataAdapter(sqlCmd);
DataSet ds = new DataSet();
string jsonString = string.Empty;
myConnection.Open();
sda.Fill(ds);
myConnection.Close();
jsonString = JsonConvert.SerializeObject(ds.Tables[5]);
return jsonString;
}